Thread: Adding more PGDLLIMPORTs

Adding more PGDLLIMPORTs

From
Craig Ringer
Date:
Hi all

As a result of some recent work on Windows I have a list of PGDLLIMPORTs I'd like to add to existing exported globals.

All affected variables are already extern, so this doesn't expose any new API not already available to non-Windows extensions.

I've split the patch up for clarity:

* v1-0001: PGDLLIMPORTs for xlog.c's XactLastRecEnd, ProcLastRecPtr and
reachedConsistency . I only really need XactLastRecEnd but think it's sensible to expose all of them.

* v1-0002: PGDLLIMPORT for struct WalRecv . Allows extensions to observe WAL receiver state and behaviour.

* v1-0003: PGDLLIMPORT criticalSharedRelcachesBuilt and criticalRelcachesBuilt . I only really need criticalSharedRelcachesBuilt but it seems sensible to export both. Useful when extension code may run during early startup (_PG_init in shared_preload_libraries, shmem init, etc) and later during normal running.

* v1-0004: PGDLLIMPORT a set of useful GUCs and vars containing GUC-derived state in xlog.h and walreceiver.h

I will follow up soon with a patch that marks every GUC as PGDLLIMPORT including any vars derived from the GUC by hooks. I don't see much point doing this piecemeal since they're all externs anyway. That patch will replace patch 4 above, but not patches 1-3.

I'd love to see these PGDLLIMPORTs backported to pg13.
Attachment