summaryrefslogtreecommitdiffstats
path: root/osdep/compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'osdep/compiler.h')
-rw-r--r--osdep/compiler.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/osdep/compiler.h b/osdep/compiler.h
index 7c9f859f3a..99fc8f0c25 100644
--- a/osdep/compiler.h
+++ b/osdep/compiler.h
@@ -23,4 +23,10 @@
#define alignof(x) (offsetof(struct {char unalign_; x u;}, u))
#endif
+#ifdef __GNUC__
+#define MP_ASSERT_UNREACHABLE() (assert(!"unreachable"), __builtin_unreachable())
+#else
+#define MP_ASSERT_UNREACHABLE() (assert(!"unreachable"), abort())
+#endif
+
#endif