aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/c.h19
-rw-r--r--src/include/postgres.h16
2 files changed, 16 insertions, 19 deletions
diff --git a/src/include/c.h b/src/include/c.h
index 9b7fe87f32b..c38ef8aed3e 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -36,9 +36,10 @@
* 8) random stuff
* 9) system-specific hacks
*
- * NOTE: since this file is included by both frontend and backend modules, it's
- * almost certainly wrong to put an "extern" declaration here. typedefs and
- * macros are the kind of thing that might go here.
+ * NOTE: since this file is included by both frontend and backend modules,
+ * it's usually wrong to put an "extern" declaration here, unless it's
+ * ifdef'd so that it's seen in only one case or the other.
+ * typedefs and macros are the kind of thing that might go here.
*
*----------------------------------------------------------------
*/
@@ -748,6 +749,18 @@ typedef NameData *Name;
#endif /* USE_ASSERT_CHECKING && !FRONTEND */
/*
+ * ExceptionalCondition is compiled into the backend whether or not
+ * USE_ASSERT_CHECKING is defined, so as to support use of extensions
+ * that are built with that #define with a backend that isn't. Hence,
+ * we should declare it as long as !FRONTEND.
+ */
+#ifndef FRONTEND
+extern void ExceptionalCondition(const char *conditionName,
+ const char *errorType,
+ const char *fileName, int lineNumber) pg_attribute_noreturn();
+#endif
+
+/*
* Macros to support compile-time assertion checks.
*
* If the "condition" (a compile-time-constant expression) evaluates to false,
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 3dc62801aa3..bbcb50e41fc 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -25,7 +25,6 @@
* ------- ------------------------------------------------
* 1) variable-length datatypes (TOAST support)
* 2) Datum type + support macros
- * 3) exception handling backend support
*
* NOTES
*
@@ -766,19 +765,4 @@ extern Datum Float8GetDatum(float8 X);
#define Float4GetDatumFast(X) PointerGetDatum(&(X))
#endif
-
-/* ----------------------------------------------------------------
- * Section 3: exception handling backend support
- * ----------------------------------------------------------------
- */
-
-/*
- * Backend only infrastructure for the assertion-related macros in c.h.
- *
- * ExceptionalCondition must be present even when assertions are not enabled.
- */
-extern void ExceptionalCondition(const char *conditionName,
- const char *errorType,
- const char *fileName, int lineNumber) pg_attribute_noreturn();
-
#endif /* POSTGRES_H */