diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-04-21 09:16:48 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-28 22:35:04 -0400 |
commit | 945c45ad50ed31e3acb96fdaafb21640c4669f12 (patch) | |
tree | ae2e59ba8d3a49bbd3c3dcece39d53aef691ed44 /compiler/main | |
parent | e5b3492f23c2296d0d8221e1787ee585331f726e (diff) | |
download | haskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz |
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'compiler/main')
-rw-r--r-- | compiler/main/DynFlags.hs | 6 | ||||
-rw-r--r-- | compiler/main/DynamicLoading.hs | 6 | ||||
-rw-r--r-- | compiler/main/SysTools.hs | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index b3600b8cfb..383a71a7e5 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2636,7 +2636,7 @@ dynamic_flags_deps = [ , make_ord_flag defGhcFlag "static" (NoArg removeWayDyn) , make_ord_flag defGhcFlag "dynamic" (NoArg (addWay WayDyn)) , make_ord_flag defGhcFlag "rdynamic" $ noArg $ -#ifdef linux_HOST_OS +#if defined(linux_HOST_OS) addOptl "-rdynamic" #elif defined (mingw32_HOST_OS) addOptl "-Wl,--export-all-symbols" @@ -4884,7 +4884,7 @@ addIncludePath p = addFrameworkPath p = upd (\s -> s{frameworkPaths = frameworkPaths s ++ splitPathList p}) -#ifndef mingw32_TARGET_OS +#if !defined(mingw32_TARGET_OS) split_marker :: Char split_marker = ':' -- not configurable (ToDo) #endif @@ -4896,7 +4896,7 @@ splitPathList s = filter notNull (splitUp s) -- cause confusion when they are translated into -I options -- for passing to gcc. where -#ifndef mingw32_TARGET_OS +#if !defined(mingw32_TARGET_OS) splitUp xs = split split_marker xs #else -- Windows: 'hybrid' support for DOS-style paths in directory lists. diff --git a/compiler/main/DynamicLoading.hs b/compiler/main/DynamicLoading.hs index 5658f2feb2..ffdce28762 100644 --- a/compiler/main/DynamicLoading.hs +++ b/compiler/main/DynamicLoading.hs @@ -2,7 +2,7 @@ -- | Dynamically lookup up values from modules and loading them. module DynamicLoading ( -#ifdef GHCI +#if defined(GHCI) -- * Loading plugins loadPlugins, loadFrontendPlugin, @@ -24,7 +24,7 @@ module DynamicLoading ( #endif ) where -#ifdef GHCI +#if defined(GHCI) import Linker ( linkModule, getHValue ) import GHCi ( wormhole ) import SrcLoc ( noSrcSpan ) @@ -66,7 +66,7 @@ import Data.List ( intercalate ) #endif -#ifdef GHCI +#if defined(GHCI) loadPlugins :: HscEnv -> IO [(ModuleName, Plugin, [CommandLineOption])] loadPlugins hsc_env diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index 16f8d1aa79..ad2e33c85c 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -81,7 +81,7 @@ import Data.List import qualified Data.Map as Map import qualified Data.Set as Set -#ifndef mingw32_HOST_OS +#if !defined(mingw32_HOST_OS) import qualified System.Posix.Internals #else /* Must be Win32 */ import Foreign @@ -102,7 +102,7 @@ import Control.Concurrent import FastString import SrcLoc ( SrcLoc, mkSrcLoc, noSrcSpan, mkSrcSpan ) -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) # if defined(i386_HOST_ARCH) # define WINDOWS_CCONV stdcall # elif defined(x86_64_HOST_ARCH) @@ -1539,7 +1539,7 @@ foreign import WINDOWS_CCONV unsafe "dynamic" getBaseDir = return Nothing #endif -#ifdef mingw32_HOST_OS +#if defined(mingw32_HOST_OS) foreign import ccall unsafe "_getpid" getProcessID :: IO Int -- relies on Int == Int32 on Windows #else getProcessID :: IO Int |