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 /Git | |
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 'Git')
-rw-r--r-- | Git/Construct.hs | 8 | ||||
-rw-r--r-- | Git/CurrentRepo.hs | 2 | ||||
-rw-r--r-- | Git/FilePath.hs | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Git/Construct.hs b/Git/Construct.hs index 6f58e9b28..586fa8c03 100644 --- a/Git/Construct.hs +++ b/Git/Construct.hs @@ -25,7 +25,7 @@ module Git.Construct ( {-# LANGUAGE CPP #-} -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS import System.Posix.User #else import Git.FilePath @@ -146,7 +146,7 @@ fromRemoteLocation :: String -> Repo -> IO Repo fromRemoteLocation s repo = gen $ calcloc s where gen v -#ifdef __WINDOWS__ +#ifdef mingw32_HOST_OS | dosstyle v = fromRemotePath (dospath v) repo #endif | scpstyle v = fromUrl $ scptourl v @@ -182,7 +182,7 @@ fromRemoteLocation s repo = gen $ calcloc s | "/" `isPrefixOf` d = d | "~" `isPrefixOf` d = '/':d | otherwise = "/~/" ++ d -#ifdef __WINDOWS__ +#ifdef mingw32_HOST_OS -- git on Windows will write a path to .git/config with "drive:", -- which is not to be confused with a "host:" dosstyle = hasDrive @@ -208,7 +208,7 @@ repoAbsPath d = do return $ h </> d' expandTilde :: FilePath -> IO FilePath -#ifdef __WINDOWS__ +#ifdef mingw32_HOST_OS expandTilde = return #else expandTilde = expandt True diff --git a/Git/CurrentRepo.hs b/Git/CurrentRepo.hs index 2a8807488..777caa981 100644 --- a/Git/CurrentRepo.hs +++ b/Git/CurrentRepo.hs @@ -41,7 +41,7 @@ get = do return $ addworktree wt r where pathenv s = do -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS v <- getEnv s case v of Just d -> do diff --git a/Git/FilePath.hs b/Git/FilePath.hs index c3813fe9e..891f9991d 100644 --- a/Git/FilePath.hs +++ b/Git/FilePath.hs @@ -44,14 +44,14 @@ asTopFilePath file = TopFilePath file type InternalGitPath = String toInternalGitPath :: FilePath -> InternalGitPath -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS toInternalGitPath = id #else toInternalGitPath = replace "\\" "/" #endif fromInternalGitPath :: InternalGitPath -> FilePath -#ifndef __WINDOWS__ +#ifndef mingw32_HOST_OS fromInternalGitPath = id #else fromInternalGitPath = replace "/" "\\" |