Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2059c5e

Browse files
committed
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 <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/a6a6b48e-ca0a-b58d-18de-98e40d94b842%40enterprisedb.com
1 parent 421ccaa commit 2059c5e

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/include/c.h

-7
Original file line numberDiff line numberDiff line change
@@ -1327,13 +1327,6 @@ typedef intptr_t sigjmp_buf[5];
13271327
#endif /* __MINGW64__ */
13281328
#endif /* WIN32 */
13291329

1330-
/* EXEC_BACKEND defines */
1331-
#ifdef EXEC_BACKEND
1332-
#define NON_EXEC_STATIC
1333-
#else
1334-
#define NON_EXEC_STATIC static
1335-
#endif
1336-
13371330
/* /port compatibility functions */
13381331
#include "port.h"
13391332

src/include/postgres.h

+20
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* ------- ------------------------------------------------
2626
* 1) variable-length datatypes (TOAST support)
2727
* 2) Datum type + support macros
28+
* 3) miscellaneous
2829
*
2930
* NOTES
3031
*
@@ -805,4 +806,23 @@ extern Datum Float8GetDatum(float8 X);
805806
#define Float8GetDatumFast(X) PointerGetDatum(&(X))
806807
#endif
807808

809+
810+
/* ----------------------------------------------------------------
811+
* Section 3: miscellaneous
812+
* ----------------------------------------------------------------
813+
*/
814+
815+
/*
816+
* NON_EXEC_STATIC: It's sometimes useful to define a variable or function
817+
* that is normally static but extern when using EXEC_BACKEND (see
818+
* pg_config_manual.h). There would then typically be some code in
819+
* postmaster.c that uses those extern symbols to transfer state between
820+
* processes or do whatever other things it needs to do in EXEC_BACKEND mode.
821+
*/
822+
#ifdef EXEC_BACKEND
823+
#define NON_EXEC_STATIC
824+
#else
825+
#define NON_EXEC_STATIC static
826+
#endif
827+
808828
#endif /* POSTGRES_H */

0 commit comments

Comments
 (0)