I ran src/tools/mark_pgdllimport.pl and it detected a few new global
variables with missing markings. See attached patch. Please point out
if any of these should not be marked or if they are special cases in
some other way. I'm Cc'ing various people involved with that new code.
Btw., this new variable in memutils.h
extern dsa_area *area;
could probably do with a less generic name?
From e9d868a38b50c1fa449258926c40cef88bd73045 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <pe...@eisentraut.org>
Date: Wed, 9 Apr 2025 11:55:48 +0200
Subject: [PATCH] WIP: Add missing PGDLLIMPORT markings
Cc: Daniel Gustafsson <dan...@yesql.se> (commit b3f0be788af, 042a66291b0)
Cc: Jacob Champion <jacob.champ...@enterprisedb.com> (commit b3f0be788af)
Cc: Heikki Linnakangas <heikki.linnakan...@iki.fi> (commit a78af042701)
Cc: Andres Freund <and...@anarazel.de> (commit 047cba7fa0f, 50cb7505b301)
Cc: Rahila Syed <rahilasye...@gmail.com> (commit 042a66291b0)
---
src/include/libpq/oauth.h | 2 +-
src/include/postmaster/postmaster.h | 4 ++--
src/include/storage/bufmgr.h | 4 ++--
src/include/storage/md.h | 2 +-
src/include/storage/smgr.h | 2 +-
src/include/utils/memutils.h | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/include/libpq/oauth.h b/src/include/libpq/oauth.h
index 2c6892ffba4..3f4c9acd8b0 100644
--- a/src/include/libpq/oauth.h
+++ b/src/include/libpq/oauth.h
@@ -91,7 +91,7 @@ typedef const OAuthValidatorCallbacks
*(*OAuthValidatorModuleInit) (void);
extern PGDLLEXPORT const OAuthValidatorCallbacks
*_PG_oauth_validator_module_init(void);
/* Implementation */
-extern const pg_be_sasl_mech pg_be_oauth_mech;
+extern PGDLLIMPORT const pg_be_sasl_mech pg_be_oauth_mech;
/*
* Ensure a validator named in the HBA is permitted by the configuration.
diff --git a/src/include/postmaster/postmaster.h
b/src/include/postmaster/postmaster.h
index 39566ee2bd5..92497cd6a0f 100644
--- a/src/include/postmaster/postmaster.h
+++ b/src/include/postmaster/postmaster.h
@@ -48,7 +48,7 @@ typedef struct
} PMChild;
#ifdef EXEC_BACKEND
-extern int num_pmchild_slots;
+extern PGDLLIMPORT int num_pmchild_slots;
#endif
/* GUC options */
@@ -117,7 +117,7 @@ pg_noreturn extern void SubPostmasterMain(int argc, char
*argv[]);
#endif
/* defined in pmchild.c */
-extern dlist_head ActiveChildList;
+extern PGDLLIMPORT dlist_head ActiveChildList;
extern void InitPostmasterChildSlots(void);
extern PMChild *AssignPostmasterChildSlot(BackendType btype);
diff --git a/src/include/storage/bufmgr.h b/src/include/storage/bufmgr.h
index 96150a6cfe9..33a8b8c06fb 100644
--- a/src/include/storage/bufmgr.h
+++ b/src/include/storage/bufmgr.h
@@ -173,8 +173,8 @@ extern PGDLLIMPORT int checkpoint_flush_after;
extern PGDLLIMPORT int backend_flush_after;
extern PGDLLIMPORT int bgwriter_flush_after;
-extern const PgAioHandleCallbacks aio_shared_buffer_readv_cb;
-extern const PgAioHandleCallbacks aio_local_buffer_readv_cb;
+extern PGDLLIMPORT const PgAioHandleCallbacks aio_shared_buffer_readv_cb;
+extern PGDLLIMPORT const PgAioHandleCallbacks aio_local_buffer_readv_cb;
/* in buf_init.c */
extern PGDLLIMPORT char *BufferBlocks;
diff --git a/src/include/storage/md.h b/src/include/storage/md.h
index 9d7131eff43..f630b75446c 100644
--- a/src/include/storage/md.h
+++ b/src/include/storage/md.h
@@ -20,7 +20,7 @@
#include "storage/smgr.h"
#include "storage/sync.h"
-extern const PgAioHandleCallbacks aio_md_readv_cb;
+extern PGDLLIMPORT const PgAioHandleCallbacks aio_md_readv_cb;
/* md storage manager functionality */
extern void mdinit(void);
diff --git a/src/include/storage/smgr.h b/src/include/storage/smgr.h
index 856ebcda350..3964d9334b3 100644
--- a/src/include/storage/smgr.h
+++ b/src/include/storage/smgr.h
@@ -74,7 +74,7 @@ typedef SMgrRelationData *SMgrRelation;
#define SmgrIsTemp(smgr) \
RelFileLocatorBackendIsTemp((smgr)->smgr_rlocator)
-extern const PgAioTargetInfo aio_smgr_target_info;
+extern PGDLLIMPORT const PgAioTargetInfo aio_smgr_target_info;
extern void smgrinit(void);
extern SMgrRelation smgropen(RelFileLocator rlocator, ProcNumber backend);
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index d328270fafc..a31b2c699a5 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -400,5 +400,5 @@ extern void HandleGetMemoryContextInterrupt(void);
extern Size MemoryContextReportingShmemSize(void);
extern void MemoryContextReportingShmemInit(void);
extern void AtProcExit_memstats_cleanup(int code, Datum arg);
-extern dsa_area *area;
+extern PGDLLIMPORT dsa_area *area;
#endif /* MEMUTILS_H */
--
2.49.0