summaryrefslogtreecommitdiff
path: root/rts/win32
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 /rts/win32
parente5b3492f23c2296d0d8221e1787ee585331f726e (diff)
downloadhaskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/AsyncIO.c2
-rw-r--r--rts/win32/ConsoleHandler.c2
-rw-r--r--rts/win32/GetTime.c2
-rw-r--r--rts/win32/OSMem.c2
-rw-r--r--rts/win32/OSThreads.c6
-rw-r--r--rts/win32/ThrIOManager.c2
-rw-r--r--rts/win32/veh_excn.c2
7 files changed, 9 insertions, 9 deletions
diff --git a/rts/win32/AsyncIO.c b/rts/win32/AsyncIO.c
index 9e6594f601..3f1e9ed63e 100644
--- a/rts/win32/AsyncIO.c
+++ b/rts/win32/AsyncIO.c
@@ -218,7 +218,7 @@ shutdownAsyncIO(bool wait_threads)
int
awaitRequests(bool wait)
{
-#ifndef THREADED_RTS
+#if !defined(THREADED_RTS)
// none of this is actually used in the threaded RTS
start:
diff --git a/rts/win32/ConsoleHandler.c b/rts/win32/ConsoleHandler.c
index d30fd81e67..3d283b0162 100644
--- a/rts/win32/ConsoleHandler.c
+++ b/rts/win32/ConsoleHandler.c
@@ -272,7 +272,7 @@ rts_InstallConsoleEvent(int action, StgStablePtr *handler)
}
break;
case STG_SIG_HAN:
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
// handler is stored in an MVar in the threaded RTS
console_handler = STG_SIG_HAN;
#else
diff --git a/rts/win32/GetTime.c b/rts/win32/GetTime.c
index 30f1068f3a..90c0d0d244 100644
--- a/rts/win32/GetTime.c
+++ b/rts/win32/GetTime.c
@@ -11,7 +11,7 @@
#include <windows.h>
-#ifdef HAVE_TIME_H
+#if defined(HAVE_TIME_H)
# include <time.h>
#endif
diff --git a/rts/win32/OSMem.c b/rts/win32/OSMem.c
index ad72ffba29..c67b95be82 100644
--- a/rts/win32/OSMem.c
+++ b/rts/win32/OSMem.c
@@ -441,7 +441,7 @@ void setExecutable (void *p, W_ len, bool exec)
}
}
-#ifdef USE_LARGE_ADDRESS_SPACE
+#if defined(USE_LARGE_ADDRESS_SPACE)
static void* heap_base = NULL;
diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c
index d2f867ccc7..4deb14a5f4 100644
--- a/rts/win32/OSThreads.c
+++ b/rts/win32/OSThreads.c
@@ -150,7 +150,7 @@ osThreadIsAlive(OSThreadId id)
return (exit_code == STILL_ACTIVE);
}
-#ifdef USE_CRITICAL_SECTIONS
+#if defined(USE_CRITICAL_SECTIONS)
void
initMutex (Mutex* pMut)
{
@@ -195,7 +195,7 @@ getThreadLocalVar (ThreadLocalKey *key)
{
void *r;
r = TlsGetValue(*key);
-#ifdef DEBUG
+#if defined(DEBUG)
// r is allowed to be NULL - it can mean that either there was an
// error or the stored value is in fact NULL.
if (GetLastError() != NO_ERROR) {
@@ -257,7 +257,7 @@ forkOS_createThread ( HsStablePtr entry )
typedef DWORD(WINAPI *GetItemCountProc)(WORD);
typedef DWORD(WINAPI *GetGroupCountProc)(void);
typedef BOOL(WINAPI *SetThreadGroupAffinityProc)(HANDLE, const GROUP_AFFINITY*, PGROUP_AFFINITY);
-#ifndef ALL_PROCESSOR_GROUPS
+#if !defined(ALL_PROCESSOR_GROUPS)
#define ALL_PROCESSOR_GROUPS 0xffff
#endif
#endif
diff --git a/rts/win32/ThrIOManager.c b/rts/win32/ThrIOManager.c
index 13c5e220bb..86133b6000 100644
--- a/rts/win32/ThrIOManager.c
+++ b/rts/win32/ThrIOManager.c
@@ -36,7 +36,7 @@ getIOManagerEvent (void)
// This function has to exist even in the non-THREADED_RTS,
// because code in GHC.Conc refers to it. It won't ever be called
// unless we're in the threaded RTS, however.
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
HANDLE hRes;
ACQUIRE_LOCK(&event_buf_mutex);
diff --git a/rts/win32/veh_excn.c b/rts/win32/veh_excn.c
index c94dc5a830..d925ad8919 100644
--- a/rts/win32/veh_excn.c
+++ b/rts/win32/veh_excn.c
@@ -22,7 +22,7 @@
#define CALL_LAST 0
// this should be in <excpt.h>, but it's been removed from MinGW distributions
-#ifndef EH_UNWINDING
+#if !defined(EH_UNWINDING)
#define EH_UNWINDING 0x02
#endif /* EH_UNWINDING */