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 /rts/Globals.c | |
parent | e5b3492f23c2296d0d8221e1787ee585331f726e (diff) | |
download | haskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz |
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'rts/Globals.c')
-rw-r--r-- | rts/Globals.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rts/Globals.c b/rts/Globals.c index b5da6d9295..66c17d0f96 100644 --- a/rts/Globals.c +++ b/rts/Globals.c @@ -41,7 +41,7 @@ typedef enum { MaxStoreKey } StoreKey; -#ifdef THREADED_RTS +#if defined(THREADED_RTS) Mutex globalStoreLock; #endif @@ -54,7 +54,7 @@ initGlobalStore(void) for (i=0; i < MaxStoreKey; i++) { store[i] = 0; } -#ifdef THREADED_RTS +#if defined(THREADED_RTS) initMutex(&globalStoreLock); #endif } @@ -63,7 +63,7 @@ void exitGlobalStore(void) { uint32_t i; -#ifdef THREADED_RTS +#if defined(THREADED_RTS) closeMutex(&globalStoreLock); #endif for (i=0; i < MaxStoreKey; i++) { @@ -78,13 +78,13 @@ static StgStablePtr getOrSetKey(StoreKey key, StgStablePtr ptr) { StgStablePtr ret = store[key]; if(ret==0) { -#ifdef THREADED_RTS +#if defined(THREADED_RTS) ACQUIRE_LOCK(&globalStoreLock); ret = store[key]; if(ret==0) { #endif store[key] = ret = ptr; -#ifdef THREADED_RTS +#if defined(THREADED_RTS) } RELEASE_LOCK(&globalStoreLock); #endif |