summaryrefslogtreecommitdiff
path: root/includes/stg/HaskellMachRegs.h
diff options
context:
space:
mode:
authorErik de Castro Lopo <erik.decastrolopo@ambiata.com>2017-04-05 05:53:46 +1000
committerBen Gamari <ben@smart-cactus.org>2017-04-28 22:35:04 -0400
commite5b3492f23c2296d0d8221e1787ee585331f726e (patch)
treee1d6797dadc265db7f97615ff71c65c3d83db9c0 /includes/stg/HaskellMachRegs.h
parent6d14c1485cb570cbd183bcdc0f858d9a6dc1eb31 (diff)
downloadhaskell-e5b3492f23c2296d0d8221e1787ee585331f726e.tar.gz
Enable new warning for fragile/incorrect CPP #if usage
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. Test Plan: Validate on Linux and Windows Reviewers: austin, angerman, simonmar, bgamari, Phyx Reviewed By: bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3278
Diffstat (limited to 'includes/stg/HaskellMachRegs.h')
-rw-r--r--includes/stg/HaskellMachRegs.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/includes/stg/HaskellMachRegs.h b/includes/stg/HaskellMachRegs.h
index 37e687bc4e..89a2b95399 100644
--- a/includes/stg/HaskellMachRegs.h
+++ b/includes/stg/HaskellMachRegs.h
@@ -32,14 +32,34 @@
#define MACHREGS_NO_REGS 0
-#define MACHREGS_i386 i386_TARGET_ARCH
-#define MACHREGS_x86_64 x86_64_TARGET_ARCH
-#define MACHREGS_powerpc (powerpc_TARGET_ARCH || powerpc64_TARGET_ARCH \
- || powerpc64le_TARGET_ARCH || rs6000_TARGET_ARCH)
-#define MACHREGS_sparc sparc_TARGET_ARCH
-#define MACHREGS_arm arm_TARGET_ARCH
-#define MACHREGS_aarch64 aarch64_TARGET_ARCH
-#define MACHREGS_darwin darwin_TARGET_OS
+#ifdef i386_TARGET_ARCH
+#define MACHREGS_i386 1
+#endif
+
+#ifdef x86_64_TARGET_ARCH
+#define MACHREGS_x86_64 1
+#endif
+
+#if defined(powerpc_TARGET_ARCH) || defined(powerpc64_TARGET_ARCH) \
+ || defined(powerpc64le_TARGET_ARCH) || defined(rs6000_TARGET_ARCH)
+#define MACHREGS_powerpc 1
+#endif
+
+#ifdef sparc_TARGET_ARCH
+#define MACHREGS_sparc 1
+#endif
+
+#ifdef arm_TARGET_ARCH
+#define MACHREGS_arm 1
+#endif
+
+#ifdef aarch64_TARGET_ARCH
+#define MACHREGS_aarch64 1
+#endif
+
+#ifdef darwin_TARGET_OS
+#define MACHREGS_darwin 1
+#endif
#endif