Skip to content

Commit

Permalink
Move NON_EXEC_STATIC from c.h to postgres.h
Browse files Browse the repository at this point in the history
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
(cherry picked from commit 2059c5e3b06545e7d0650dba9c665332374c3c21)
  • Loading branch information
petere authored and 2jungkook committed Dec 2, 2023
1 parent f23e9a2 commit 2a051a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/include/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
20 changes: 20 additions & 0 deletions src/include/postgres.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* ------- ------------------------------------------------
* 1) variable-length datatypes (TOAST support)
* 2) Datum type + support macros
* 3) miscellaneous
*
* NOTES
*
Expand Down Expand Up @@ -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 */

0 comments on commit 2a051a9

Please sign in to comment.