diff options
author | Joey Hess <joey@kitenet.net> | 2013-08-02 12:27:32 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-08-02 12:27:32 -0400 |
commit | 250a25c8572e557772a9973542f9cfca6ac10b9b (patch) | |
tree | 7d4aaa36a7d5b6c3c5e03fb844fb844da4c037d2 /Annex | |
parent | a39c161ab377eed381186bc57953cd59d6188108 (diff) |
get rid of __WINDOWS__, use mingw32_HOST_OS
The latter is harder for me to remember, but avoids build failures in code
used by the configure program.
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 6 | ||||
-rw-r--r-- | Annex/Environment.hs | 2 | ||||
-rw-r--r-- | Annex/Journal.hs | 4 | ||||
-rw-r--r-- | Annex/LockPool.hs | 4 | ||||
-rw-r--r-- | Annex/Ssh.hs | 2 | ||||
-rw-r--r-- | Annex/Version.hs | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index 96f9d78fc..2a109e3e3 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -92,14 +92,14 @@ inAnnexSafe = inAnnex' (fromMaybe False) (Just False) go where go f = liftIO $ openforlock f >>= check openforlock f = catchMaybeIO $ -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS openFd f ReadOnly Nothing defaultFileFlags #else return () #endif check Nothing = return is_missing check (Just h) = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS v <- getLock h (ReadLock, AbsoluteSeek, 0, 0) closeFd h return $ case v of @@ -116,7 +116,7 @@ inAnnexSafe = inAnnex' (fromMaybe False) (Just False) go - it. (If the content is not present, no locking is done.) -} lockContent :: Key -> Annex a -> Annex a lockContent key a = do -#ifdef __WINDOWS__ +#ifdef mingw32_HOST_OS a #else file <- calcRepo $ gitAnnexLocation key diff --git a/Annex/Environment.hs b/Annex/Environment.hs index 18097d11d..ce9c33ad6 100644 --- a/Annex/Environment.hs +++ b/Annex/Environment.hs @@ -34,7 +34,7 @@ checkEnvironment = do checkEnvironmentIO :: IO () checkEnvironmentIO = -#ifdef __WINDOWS__ +#ifdef mingw32_HOST_OS noop #else whenM (null <$> myUserGecos) $ do diff --git a/Annex/Journal.hs b/Annex/Journal.hs index 0f0803aaa..506cbfcaf 100644 --- a/Annex/Journal.hs +++ b/Annex/Journal.hs @@ -87,7 +87,7 @@ lockJournal a = do bracketIO (lock lockfile mode) unlock (const a) where lock lockfile mode = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS l <- noUmask mode $ createFile lockfile mode waitToSetLock l (WriteLock, AbsoluteSeek, 0, 0) return l @@ -95,7 +95,7 @@ lockJournal a = do writeFile lockfile "" return lockfile #endif -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS unlock = closeFd #else unlock = removeFile diff --git a/Annex/LockPool.hs b/Annex/LockPool.hs index d8bc08485..40673bd7e 100644 --- a/Annex/LockPool.hs +++ b/Annex/LockPool.hs @@ -22,7 +22,7 @@ lockFile file = go =<< fromPool file where go (Just _) = noop -- already locked go Nothing = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS mode <- annexFileMode fd <- liftIO $ noUmask mode $ openFd file ReadOnly (Just mode) defaultFileFlags @@ -37,7 +37,7 @@ unlockFile :: FilePath -> Annex () unlockFile file = maybe noop go =<< fromPool file where go fd = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS liftIO $ closeFd fd #endif changePool $ M.delete file diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 182cc0298..4fdac28ad 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -98,7 +98,7 @@ sshCleanup = go =<< sshCacheDir liftIO (catchDefaultIO [] $ dirContents dir) forM_ sockets cleanup cleanup socketfile = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS -- Drop any shared lock we have, and take an -- exclusive lock, without blocking. If the lock -- succeeds, nothing is using this ssh, and it can diff --git a/Annex/Version.hs b/Annex/Version.hs index 7859707d3..05b3f0227 100644 --- a/Annex/Version.hs +++ b/Annex/Version.hs @@ -25,7 +25,7 @@ supportedVersions :: [Version] supportedVersions = [defaultVersion, directModeVersion] upgradableVersions :: [Version] -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS upgradableVersions = ["0", "1", "2"] #else upgradableVersions = ["2"] |