summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2022-08-25 13:07:03 +0000
committerPeter Eisentraut2022-08-25 13:07:03 +0000
commit2059c5e3b06545e7d0650dba9c665332374c3c21 (patch)
tree721a0f3bd0895bede55e4fed7d1b2e89c901e91f
parent421ccaa6272a2935a3d2e578ff6feeeeab7d8848 (diff)
Move NON_EXEC_STATIC from c.h to postgres.h
It is not needed at the scope of c.h, only in backend code. Reviewed-by: Tom Lane <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/a6a6b48e-ca0a-b58d-18de-98e40d94b842%40enterprisedb.com
-rw-r--r--src/include/c.h7
-rw-r--r--src/include/postgres.h20
2 files changed, 20 insertions, 7 deletions
diff --git a/src/include/c.h b/src/include/c.h
index a381f9a6c40..101ba41331e 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -1327,13 +1327,6 @@ typedef intptr_t sigjmp_buf[5];
#endif /* __MINGW64__ */
#endif /* WIN32 */
-/* EXEC_BACKEND defines */
-#ifdef EXEC_BACKEND
-#define NON_EXEC_STATIC
-#else
-#define NON_EXEC_STATIC static
-#endif
-
/* /port compatibility functions */
#include "port.h"
diff --git a/src/include/postgres.h b/src/include/postgres.h
index 31358110dca..13903fa022a 100644
--- a/src/include/postgres.h
+++ b/src/include/postgres.h
@@ -25,6 +25,7 @@
* ------- ------------------------------------------------
* 1) variable-length datatypes (TOAST support)
* 2) Datum type + support macros
+ * 3) miscellaneous
*
* NOTES
*
@@ -805,4 +806,23 @@ extern Datum Float8GetDatum(float8 X);
#define Float8GetDatumFast(X) PointerGetDatum(&(X))
#endif
+
+/* ----------------------------------------------------------------
+ * Section 3: miscellaneous
+ * ----------------------------------------------------------------
+ */
+
+/*
+ * NON_EXEC_STATIC: It's sometimes useful to define a variable or function
+ * that is normally static but extern when using EXEC_BACKEND (see
+ * pg_config_manual.h). There would then typically be some code in
+ * postmaster.c that uses those extern symbols to transfer state between
+ * processes or do whatever other things it needs to do in EXEC_BACKEND mode.
+ */
+#ifdef EXEC_BACKEND
+#define NON_EXEC_STATIC
+#else
+#define NON_EXEC_STATIC static
+#endif
+
#endif /* POSTGRES_H */