summaryrefslogtreecommitdiffstats
path: root/listen/listen.h
diff options
context:
space:
mode:
Diffstat (limited to 'listen/listen.h')
-rw-r--r--listen/listen.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/listen/listen.h b/listen/listen.h
index 0075bf3..46ec397 100644
--- a/listen/listen.h
+++ b/listen/listen.h
@@ -1,3 +1,23 @@
+#define GCC_VERSION (__GNUC__ * 10000 \
+ + __GNUC_MINOR__ * 100 \
+ + __GNUC_PATCHLEVEL__)
+
+#if GCC_VERSION >= 40500
+
+/*
+ * Mark a position in code as unreachable. This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ *
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
+ * this in the preprocessor, but we can live with this because they're
+ * unreleased.
+ */
+#define unreachable() \
+ do { __builtin_unreachable(); } while (0)
+#else
+#define unreachable() do { } while (1)
+#endif
#define T_ERROR 1
#define T_PORT 2