summaryrefslogtreecommitdiff
path: root/compiler/utils
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 /compiler/utils
parente5b3492f23c2296d0d8221e1787ee585331f726e (diff)
downloadhaskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Panic.hs2
-rw-r--r--compiler/utils/Util.hs20
2 files changed, 11 insertions, 11 deletions
diff --git a/compiler/utils/Panic.hs b/compiler/utils/Panic.hs
index b12d677a1e..0a21f251fb 100644
--- a/compiler/utils/Panic.hs
+++ b/compiler/utils/Panic.hs
@@ -38,7 +38,7 @@ import Debug.Trace ( trace )
import System.IO.Unsafe
import System.Environment
-#ifndef mingw32_HOST_OS
+#if !defined(mingw32_HOST_OS)
import System.Posix.Signals as S
#endif
diff --git a/compiler/utils/Util.hs b/compiler/utils/Util.hs
index 1c519ebeef..a4bc8d4653 100644
--- a/compiler/utils/Util.hs
+++ b/compiler/utils/Util.hs
@@ -168,7 +168,7 @@ import qualified Data.Set as Set
import Data.Time
-#ifdef DEBUG
+#if defined(DEBUG)
import {-# SOURCE #-} Outputable ( warnPprTrace, text )
#endif
@@ -192,42 +192,42 @@ the flags are off.
-}
ghciSupported :: Bool
-#ifdef GHCI
+#if defined(GHCI)
ghciSupported = True
#else
ghciSupported = False
#endif
debugIsOn :: Bool
-#ifdef DEBUG
+#if defined(DEBUG)
debugIsOn = True
#else
debugIsOn = False
#endif
ncgDebugIsOn :: Bool
-#ifdef NCG_DEBUG
+#if defined(NCG_DEBUG)
ncgDebugIsOn = True
#else
ncgDebugIsOn = False
#endif
ghciTablesNextToCode :: Bool
-#ifdef GHCI_TABLES_NEXT_TO_CODE
+#if defined(GHCI_TABLES_NEXT_TO_CODE)
ghciTablesNextToCode = True
#else
ghciTablesNextToCode = False
#endif
isWindowsHost :: Bool
-#ifdef mingw32_HOST_OS
+#if defined(mingw32_HOST_OS)
isWindowsHost = True
#else
isWindowsHost = False
#endif
isDarwinHost :: Bool
-#ifdef darwin_HOST_OS
+#if defined(darwin_HOST_OS)
isDarwinHost = True
#else
isDarwinHost = False
@@ -326,7 +326,7 @@ zipWithEqual :: String -> (a->b->c) -> [a]->[b]->[c]
zipWith3Equal :: String -> (a->b->c->d) -> [a]->[b]->[c]->[d]
zipWith4Equal :: String -> (a->b->c->d->e) -> [a]->[b]->[c]->[d]->[e]
-#ifndef DEBUG
+#if !defined(DEBUG)
zipEqual _ = zip
zipWithEqual _ = zipWith
zipWith3Equal _ = zipWith3
@@ -544,7 +544,7 @@ notNull [] = False
notNull _ = True
only :: [a] -> a
-#ifdef DEBUG
+#if defined(DEBUG)
only [a] = a
#else
only (a:_) = a
@@ -1345,7 +1345,7 @@ type HasCallStack = (() :: Constraint)
#endif
-- | A call stack constraint, but only when 'isDebugOn'.
-#ifdef DEBUG
+#if defined(DEBUG)
type HasDebugCallStack = HasCallStack
#else
type HasDebugCallStack = (() :: Constraint)