summaryrefslogtreecommitdiff
path: root/Utility/UserInfo.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-10 16:57:21 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-10 16:57:21 -0500
commitae6293ae6710b0a7580bc9a0045c92d1d5b87036 (patch)
treefbd105bed124fb698fdc5bbdf4eb2d9ccd086979 /Utility/UserInfo.hs
parent5d0476bf59674b39fa6bad7e4446b5c741181143 (diff)
fixup #if 0 stubs to use #ifndef mingw32_HOST_OS
That's needed in files used to build the configure program. For the other files, I'm keeping my __WINDOWS__ define, as I find that much easier to type. I may search and replace it to use the mingw32_HOST_OS thing later.
Diffstat (limited to 'Utility/UserInfo.hs')
-rwxr-xr-xUtility/UserInfo.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs
index 6fad3d7b4..c0925ecb8 100755
--- a/Utility/UserInfo.hs
+++ b/Utility/UserInfo.hs
@@ -14,7 +14,7 @@ module Utility.UserInfo (
) where
import Control.Applicative
-#if 0
+#ifndef mingw32_HOST_OS
import System.Posix.User
import System.Posix.Env
#endif
@@ -23,7 +23,7 @@ import System.Posix.Env
-
- getpwent will fail on LDAP or NIS, so use HOME if set. -}
myHomeDir :: IO FilePath
-#if 0
+#ifndef mingw32_HOST_OS
myHomeDir = myVal ["HOME"] homeDirectory
#else
myHomeDir = error "myHomeDir TODO"
@@ -31,7 +31,7 @@ myHomeDir = error "myHomeDir TODO"
{- Current user's user name. -}
myUserName :: IO String
-#if 0
+#ifndef mingw32_HOST_OS
myUserName = myVal ["USER", "LOGNAME"] userName
#else
myUserName = error "myUserName TODO"
@@ -41,14 +41,14 @@ myUserGecos :: IO String
#ifdef __ANDROID__
myUserGecos = return "" -- userGecos crashes on Android
#else
-#if 0
+#ifndef mingw32_HOST_OS
myUserGecos = myVal [] userGecos
#else
myUserGecos = error "myUserGecos TODO"
#endif
#endif
-#if 0
+#ifndef mingw32_HOST_OS
myVal :: [String] -> (UserEntry -> String) -> IO String
myVal envvars extract = maybe (extract <$> getpwent) return =<< check envvars
where