summaryrefslogtreecommitdiffhomepage
path: root/src/unreachable.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/unreachable.h')
-rw-r--r--src/unreachable.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/unreachable.h b/src/unreachable.h
new file mode 100644
index 0000000..99c82b5
--- /dev/null
+++ b/src/unreachable.h
@@ -0,0 +1,14 @@
+/* This file is dedicated to the public domain. */
+
+#ifndef INC_UNREACHABLE_H
+#define INC_UNREACHABLE_H
+
+#if defined(__GNUC__) || defined(__clang__)
+#define unreachable __builtin_unreachable()
+#else
+#define unreachable do; while (0)
+#endif
+
+#endif
+
+// vi: sw=4 ts=4 noet tw=80 cc=80