aboutsummaryrefslogtreecommitdiff
path: root/src/include/c.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/c.h')
-rw-r--r--src/include/c.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/c.h b/src/include/c.h
index f7db157f83a..59af5b5cb8e 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -749,6 +749,18 @@ typedef NameData *Name;
/*
+ * Mark a point as unreachable in a portable fashion. This should preferably
+ * be something that the compiler understands, to aid code generation.
+ * In assert-enabled builds, we prefer abort() for debugging reasons.
+ */
+#if defined(HAVE__BUILTIN_UNREACHABLE) && !defined(USE_ASSERT_CHECKING)
+#define pg_unreachable() __builtin_unreachable()
+#else
+#define pg_unreachable() abort()
+#endif
+
+
+/*
* Function inlining support -- Allow modules to define functions that may be
* inlined, if the compiler supports it.
*