summaryrefslogtreecommitdiff
path: root/Utility/FileMode.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-02 12:27:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-02 12:27:32 -0400
commit250a25c8572e557772a9973542f9cfca6ac10b9b (patch)
tree7d4aaa36a7d5b6c3c5e03fb844fb844da4c037d2 /Utility/FileMode.hs
parenta39c161ab377eed381186bc57953cd59d6188108 (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 'Utility/FileMode.hs')
-rw-r--r--Utility/FileMode.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Utility/FileMode.hs b/Utility/FileMode.hs
index 47247e2a1..d76fb5703 100644
--- a/Utility/FileMode.hs
+++ b/Utility/FileMode.hs
@@ -13,7 +13,7 @@ import Common
import Control.Exception (bracket)
import System.PosixCompat.Types
-#ifndef __WINDOWS__
+#ifndef mingw32_HOST_OS
import System.Posix.Files
#endif
import Foreign (complement)
@@ -76,7 +76,7 @@ checkMode checkfor mode = checkfor `intersectFileModes` mode == checkfor
{- Checks if a file mode indicates it's a symlink. -}
isSymLink :: FileMode -> Bool
-#ifdef __WINDOWS__
+#ifdef mingw32_HOST_OS
isSymLink _ = False
#else
isSymLink = checkMode symbolicLinkMode
@@ -89,7 +89,7 @@ isExecutable mode = combineModes executeModes `intersectFileModes` mode /= 0
{- Runs an action without that pesky umask influencing it, unless the
- passed FileMode is the standard one. -}
noUmask :: FileMode -> IO a -> IO a
-#ifndef __WINDOWS__
+#ifndef mingw32_HOST_OS
noUmask mode a
| mode == stdFileMode = a
| otherwise = bracket setup cleanup go
@@ -107,7 +107,7 @@ combineModes [m] = m
combineModes (m:ms) = foldl unionFileModes m ms
isSticky :: FileMode -> Bool
-#ifdef __WINDOWS__
+#ifdef mingw32_HOST_OS
isSticky _ = False
#else
isSticky = checkMode stickyMode