summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorKarel Gardas <karel.gardas@centrum.cz>2016-08-15 22:26:04 +0200
committerKarel Gardas <karel.gardas@centrum.cz>2016-08-15 22:26:04 +0200
commit3551e622ab3a833589a069b473a4dfb3f171e5b8 (patch)
tree8726112b8021dd3cf083dddc9d4d89afd785ff61 /includes
parentfc1432aa57b01c1e3b936dcee0eb419a8c2bb2c8 (diff)
downloadhaskell-3551e622ab3a833589a069b473a4dfb3f171e5b8.tar.gz
refactor test for __builtin_unreachable into Rts.h macro RTS_UNREACHABLE
Summary: This patch refactors GNU C version test (for 4.5 and more modern) due to usage of __builtin_unreachable done in the CNF.c code directly into the new RTS_UNREACHABLE macro placed into Rts.h Reviewers: bgamari, austin, simonmar, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2457
Diffstat (limited to 'includes')
-rw-r--r--includes/Rts.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/includes/Rts.h b/includes/Rts.h
index 3d4538f41d..be81b0d9c7 100644
--- a/includes/Rts.h
+++ b/includes/Rts.h
@@ -61,6 +61,13 @@ extern "C" {
#define RTS_UNLIKELY(p) p
#endif
+/* __builtin_unreachable is supported since GNU C 4.5 */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#define RTS_UNREACHABLE __builtin_unreachable()
+#else
+#define RTS_UNREACHABLE abort()
+#endif
+
/* Fix for mingw stat problem (done here so it's early enough) */
#ifdef mingw32_HOST_OS
#define __MSVCRT__ 1