diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2016-10-23 08:30:19 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2017-03-04 17:16:12 +1100 |
commit | 8bc809b7d3bc416d63eba96013553498c95ecc6f (patch) | |
tree | 685963d18a1e9eed2d8ee98484646b192435a8f8 /rts/posix/OSMem.c | |
parent | 96f5656d2ae885fa4b0227c4650b1c375e16dd00 (diff) | |
download | haskell-wip/erikd/rts.tar.gz |
Enable new warning for bad CPP #if usagewip/erikd/rts
The C code in the RTS now gets built with `-Wundef` and the Haskell code
(stages 1 and 2 only) with `-Wcpp-undef`. We now get warnings whereever
`#if` is used on undefined identifiers.
Diffstat (limited to 'rts/posix/OSMem.c')
-rw-r--r-- | rts/posix/OSMem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/posix/OSMem.c b/rts/posix/OSMem.c index dcf734f19d..cfacd65cdc 100644 --- a/rts/posix/OSMem.c +++ b/rts/posix/OSMem.c @@ -39,7 +39,7 @@ #include <errno.h> -#if darwin_HOST_OS || ios_HOST_OS +#if defined darwin_HOST_OS || defined 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; -#if darwin_HOST_OS +#ifdef 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; -#if hpux_HOST_OS +#ifdef hpux_HOST_OS ret = mmap(addr, size, prot, flags | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); -#elif linux_HOST_OS +#elif defined 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 |