Adding more PGDLLIMPORTs - Mailing list pgsql-hackers

From Craig Ringer
Subject Adding more PGDLLIMPORTs
Date
Msg-id CAGRY4nwC1CGTg3B-PO9fy2ZToBoX_BrRbQwG8A_J9K+E9mQW6w@mail.gmail.com
Whole thread Raw
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: subscription/t/010_truncate.pl failure on desmoxytes in REL_13_STABLE
Next
From: Peter Eisentraut
Date:
Subject: Re: Remove redundant variable pageSize in gistinitpage