summaryrefslogtreecommitdiff
path: root/rts/eventlog
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/eventlog
parente5b3492f23c2296d0d8221e1787ee585331f726e (diff)
downloadhaskell-945c45ad50ed31e3acb96fdaafb21640c4669f12.tar.gz
Prefer #if defined to #ifdef
Our new CPP linter enforces this.
Diffstat (limited to 'rts/eventlog')
-rw-r--r--rts/eventlog/EventLog.c14
-rw-r--r--rts/eventlog/EventLog.h4
-rw-r--r--rts/eventlog/EventLogWriter.c6
3 files changed, 12 insertions, 12 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index ce4cb3847a..6f09425fe1 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -9,7 +9,7 @@
#include "PosixSource.h"
#include "Rts.h"
-#ifdef TRACING
+#if defined(TRACING)
#include "Trace.h"
#include "Capability.h"
@@ -19,10 +19,10 @@
#include <string.h>
#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
+#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
-#ifdef HAVE_UNISTD_H
+#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
@@ -44,7 +44,7 @@ typedef struct _EventsBuf {
EventsBuf *capEventBuf; // one EventsBuf for each Capability
EventsBuf eventBuf; // an EventsBuf not associated with any Capability
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
Mutex eventBufMutex; // protected by this mutex
#endif
@@ -287,7 +287,7 @@ initEventLogging(const EventLogWriter *ev_writer)
* Use a single buffer to store the header with event types, then flush
* the buffer so all buffers are empty for writing events.
*/
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
// XXX n_capabilities hasn't been initislised yet
n_caps = RtsFlags.ParFlags.nCapabilities;
#else
@@ -493,7 +493,7 @@ initEventLogging(const EventLogWriter *ev_writer)
postBlockMarker(&capEventBuf[c]);
}
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
initMutex(&eventBufMutex);
#endif
}
@@ -1211,7 +1211,7 @@ void postHeapProfSampleString(StgWord8 profile_id,
RELEASE_LOCK(&eventBufMutex);
}
-#ifdef PROFILING
+#if defined(PROFILING)
void postHeapProfCostCentre(StgWord32 ccID,
const char *label,
const char *module,
diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h
index 90bb214495..11c2577745 100644
--- a/rts/eventlog/EventLog.h
+++ b/rts/eventlog/EventLog.h
@@ -14,7 +14,7 @@
#include "BeginPrivate.h"
-#ifdef TRACING
+#if defined(TRACING)
/*
* Descriptions of EventTags for events.
@@ -141,7 +141,7 @@ void postHeapProfSampleString(StgWord8 profile_id,
const char *label,
StgWord64 residency);
-#ifdef PROFILING
+#if defined(PROFILING)
void postHeapProfCostCentre(StgWord32 ccID,
const char *label,
const char *module,
diff --git a/rts/eventlog/EventLogWriter.c b/rts/eventlog/EventLogWriter.c
index d6db743119..d8e5a44192 100644
--- a/rts/eventlog/EventLogWriter.c
+++ b/rts/eventlog/EventLogWriter.c
@@ -14,10 +14,10 @@
#include <string.h>
#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
+#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
-#ifdef HAVE_UNISTD_H
+#if defined(HAVE_UNISTD_H)
#include <unistd.h>
#endif
@@ -39,7 +39,7 @@ initEventLogFileWriter(void)
prog = stgMallocBytes(strlen(prog_name) + 1, "initEventLogFileWriter");
strcpy(prog, prog_name);
-#ifdef mingw32_HOST_OS
+#if defined(mingw32_HOST_OS)
// on Windows, drop the .exe suffix if there is one
{
char *suff;