summaryrefslogtreecommitdiff
path: root/rts/posix
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-04-05 12:01:12 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-05 12:12:48 -0400
commit819c3db73acf5246cd332ad3062c61b7a2e8ee68 (patch)
tree7425f16a8771d1bb917afb65b848ebf855c8c619 /rts/posix
parent4a1eed40bec08d50634b9754448ae34666e71fb2 (diff)
downloadhaskell-819c3db73acf5246cd332ad3062c61b7a2e8ee68.tar.gz
Revert "Enable new warning for fragile/incorrect CPP #if usage"
This is causing too much platform dependent breakage at the moment. We will need a more rigorous testing strategy before this can be merged again. This reverts commit 7e340c2bbf4a56959bd1e95cdd1cfdb2b7e537c2.
Diffstat (limited to 'rts/posix')
-rw-r--r--rts/posix/GetTime.c2
-rw-r--r--rts/posix/OSMem.c8
-rw-r--r--rts/posix/OSThreads.c2
-rw-r--r--rts/posix/itimer/Pthread.c6
4 files changed, 9 insertions, 9 deletions
diff --git a/rts/posix/GetTime.c b/rts/posix/GetTime.c
index 5be9c8e350..4d25795948 100644
--- a/rts/posix/GetTime.c
+++ b/rts/posix/GetTime.c
@@ -190,7 +190,7 @@ void getUnixEpochTime(StgWord64 *sec, StgWord32 *nsec)
W_
getPageFaults(void)
{
-#if !defined(HAVE_GETRUSAGE) || defined(haiku_HOST_OS)
+#if !defined(HAVE_GETRUSAGE) || haiku_HOST_OS
return 0;
#else
struct rusage t;
diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c
index 48b154fa11..dcf734f19d 100644
--- a/rts/posix/OSMem.c
+++ b/rts/posix/OSMem.c
@@ -39,7 +39,7 @@
#include <errno.h>
-#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
+#if darwin_HOST_OS || ios_HOST_OS
#include <mach/mach.h>
#include <mach/vm_map.h>
#include <sys/sysctl.h>
@@ -114,7 +114,7 @@ my_mmap (void *addr, W_ size, int operation)
{
void *ret;
-#ifdef darwin_HOST_OS
+#if darwin_HOST_OS
// Without MAP_FIXED, Apple's mmap ignores addr.
// With MAP_FIXED, it overwrites already mapped regions, whic
// mmap(0, ... MAP_FIXED ...) is worst of all: It unmaps the program text
@@ -170,9 +170,9 @@ my_mmap (void *addr, W_ size, int operation)
else
flags = 0;
-#ifdef hpux_HOST_OS
+#if hpux_HOST_OS
ret = mmap(addr, size, prot, flags | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-#elif defined(linux_HOST_OS)
+#elif linux_HOST_OS
ret = mmap(addr, size, prot, flags | MAP_ANON | MAP_PRIVATE, -1, 0);
if (ret == (void *)-1 && errno == EPERM) {
// Linux may return EPERM if it tried to give us
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 465c8675a3..45f394208f 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -137,7 +137,7 @@ createOSThread (OSThreadId* pId, char *name STG_UNUSED,
int result = pthread_create(pId, NULL, (void *(*)(void *))startProc, param);
if (!result) {
pthread_detach(*pId);
-#ifdef HAVE_PTHREAD_SETNAME_NP
+#if HAVE_PTHREAD_SETNAME_NP
pthread_setname_np(*pId, name);
#endif
}
diff --git a/rts/posix/itimer/Pthread.c b/rts/posix/itimer/Pthread.c
index 5c708ecf4d..3b31fe4103 100644
--- a/rts/posix/itimer/Pthread.c
+++ b/rts/posix/itimer/Pthread.c
@@ -65,7 +65,7 @@
#include <unistd.h>
#include <fcntl.h>
-#ifdef HAVE_SYS_TIMERFD_H
+#if HAVE_SYS_TIMERFD_H
#include <sys/timerfd.h>
#define USE_TIMERFD_FOR_ITIMER 1
#else
@@ -101,7 +101,7 @@ static void *itimer_thread_func(void *_handle_tick)
uint64_t nticks;
int timerfd = -1;
-#if defined(USE_TIMERFD_FOR_ITIMER) && USE_TIMERFD_FOR_ITIMER
+#if USE_TIMERFD_FOR_ITIMER
struct itimerspec it;
it.it_value.tv_sec = TimeToSeconds(itimer_interval);
it.it_value.tv_nsec = TimeToNS(itimer_interval) % 1000000000;
@@ -169,7 +169,7 @@ initTicker (Time interval, TickProc handle_tick)
* to the thread we create so we can later join to it if requested
*/
if (! pthread_create(&thread, NULL, itimer_thread_func, (void*)handle_tick)) {
-#ifdef HAVE_PTHREAD_SETNAME_NP
+#if HAVE_PTHREAD_SETNAME_NP
pthread_setname_np(thread, "ghc_ticker");
#endif
} else {