aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-11-29 00:04:45 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-11-29 00:04:45 -0500
commit11b500072e42c214462b973b0b05f1c68992226b (patch)
treeab3bd4b894230d4877d600ae73697a4c3865fd6d /src
parent6fb7c5d67cdd55454fe6317f939a191f85e96473 (diff)
downloadpostgresql-11b500072e42c214462b973b0b05f1c68992226b.tar.gz
postgresql-11b500072e42c214462b973b0b05f1c68992226b.zip
Portability hack for pg_global_prng_state.
PGDLLIMPORT is only appropriate for variables declared in the backend, not when the variable is coming from a library included in frontend code. (This isn't a particularly nice fix, but for now, use the same method employed elsewhere.) Discussion: https://postgr.es/m/E1mrWUD-000235-Hq@gemulon.postgresql.org
Diffstat (limited to 'src')
-rw-r--r--src/include/common/pg_prng.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/common/pg_prng.h b/src/include/common/pg_prng.h
index 623c65ae731..e4df5165d7e 100644
--- a/src/include/common/pg_prng.h
+++ b/src/include/common/pg_prng.h
@@ -26,7 +26,11 @@ typedef struct pg_prng_state
* Callers not needing local PRNG series may use this global state vector,
* after initializing it with one of the pg_prng_...seed functions.
*/
+#ifndef FRONTEND
extern PGDLLIMPORT pg_prng_state pg_global_prng_state;
+#else
+extern pg_prng_state pg_global_prng_state;
+#endif
extern void pg_prng_seed(pg_prng_state *state, uint64 seed);
extern void pg_prng_fseed(pg_prng_state *state, double fseed);