summaryrefslogtreecommitdiff
path: root/ghc/GHCi/UI.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-04-21 09:16:48 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-28 22:35:04 -0400
commit945c45ad50ed31e3acb96fdaafb21640c4669f12 (patch)
treeae2e59ba8d3a49bbd3c3dcece39d53aef691ed44 /ghc/GHCi/UI.hs
parente5b3492f23c2296d0d8221e1787ee585331f726e (diff)
downloadhaskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'ghc/GHCi/UI.hs')
-rw-r--r--ghc/GHCi/UI.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index ab6c2dc199..52a809ea3d 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -122,7 +122,7 @@ import Text.Read.Lex (isSymbolChar)
import Unsafe.Coerce
-#ifndef mingw32_HOST_OS
+#if !defined(mingw32_HOST_OS)
import System.Posix hiding ( getEnv )
#else
import qualified System.Win32
@@ -379,7 +379,7 @@ findEditor :: IO String
findEditor = do
getEnv "EDITOR"
`catchIO` \_ -> do
-#ifdef mingw32_HOST_OS
+#if defined(mingw32_HOST_OS)
win <- System.Win32.getWindowsDirectory
return (win </> "notepad.exe")
#else
@@ -669,7 +669,7 @@ checkFileAndDirPerms file = do
d -> d
checkPerms :: FilePath -> IO Bool
-#ifdef mingw32_HOST_OS
+#if defined(mingw32_HOST_OS)
checkPerms _ = return True
#else
checkPerms file =
@@ -720,7 +720,7 @@ formatCurrentTime format =
getUserName :: IO String
getUserName = do
-#ifdef mingw32_HOST_OS
+#if defined(mingw32_HOST_OS)
getEnv "USERNAME"
`catchIO` \e -> do
putStrLn $ show e