Skip to content

Commit 8ec5694

Browse files
committed
Apply PGDLLIMPORT markings broadly.
Up until now, we've had a policy of only marking certain variables in the PostgreSQL header files with PGDLLIMPORT, but now we've decided to mark them all. This means that extensions running on Windows should no longer operate at a disadvantage as compared to extensions running on Linux: if the variable is present in a header file, it should be accessible. Discussion: http://postgr.es/m/CA+TgmoYanc1_FSfimhgiWSqVyP5KKmh5NP2BWNwDhO8Pg2vGYQ@mail.gmail.com
1 parent 80900d4 commit 8ec5694

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+434
-429
lines changed

src/include/access/gin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ typedef char GinTernaryValue;
6868

6969
/* GUC parameters */
7070
extern PGDLLIMPORT int GinFuzzySearchLimit;
71-
extern int gin_pending_list_limit;
71+
extern PGDLLIMPORT int gin_pending_list_limit;
7272

7373
/* ginutil.c */
7474
extern void ginGetStats(Relation index, GinStatsData *stats);

src/include/access/parallel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef struct ParallelWorkerContext
5454
shm_toc *toc;
5555
} ParallelWorkerContext;
5656

57-
extern volatile bool ParallelMessagePending;
57+
extern PGDLLIMPORT volatile bool ParallelMessagePending;
5858
extern PGDLLIMPORT int ParallelWorkerNumber;
5959
extern PGDLLIMPORT bool InitializingParallelWorker;
6060

src/include/access/session.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ extern void AttachSession(dsm_handle handle);
3939
extern void DetachSession(void);
4040

4141
/* The current session, or NULL for none. */
42-
extern Session *CurrentSession;
42+
extern PGDLLIMPORT Session *CurrentSession;
4343

4444
#endif /* SESSION_H */

src/include/access/tableam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#define DEFAULT_TABLE_ACCESS_METHOD "heap"
2929

3030
/* GUCs */
31-
extern char *default_table_access_method;
32-
extern bool synchronize_seqscans;
31+
extern PGDLLIMPORT char *default_table_access_method;
32+
extern PGDLLIMPORT bool synchronize_seqscans;
3333

3434

3535
struct BulkInsertStateData;

src/include/access/toast_compression.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* but the value is one of the char values defined below, as they appear in
2121
* pg_attribute.attcompression, e.g. TOAST_PGLZ_COMPRESSION.
2222
*/
23-
extern int default_toast_compression;
23+
extern PGDLLIMPORT int default_toast_compression;
2424

2525
/*
2626
* Built-in compression method ID. The toast compression header will store

src/include/access/twophase_rmgr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ typedef uint8 TwoPhaseRmgrId;
2828
#define TWOPHASE_RM_PREDICATELOCK_ID 4
2929
#define TWOPHASE_RM_MAX_ID TWOPHASE_RM_PREDICATELOCK_ID
3030

31-
extern const TwoPhaseCallback twophase_recover_callbacks[];
32-
extern const TwoPhaseCallback twophase_postcommit_callbacks[];
33-
extern const TwoPhaseCallback twophase_postabort_callbacks[];
34-
extern const TwoPhaseCallback twophase_standby_recover_callbacks[];
31+
extern PGDLLIMPORT const TwoPhaseCallback twophase_recover_callbacks[];
32+
extern PGDLLIMPORT const TwoPhaseCallback twophase_postcommit_callbacks[];
33+
extern PGDLLIMPORT const TwoPhaseCallback twophase_postabort_callbacks[];
34+
extern PGDLLIMPORT const TwoPhaseCallback twophase_standby_recover_callbacks[];
3535

3636

3737
extern void RegisterTwoPhaseRecord(TwoPhaseRmgrId rmid, uint16 info,

src/include/access/xact.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#define XACT_REPEATABLE_READ 2
3939
#define XACT_SERIALIZABLE 3
4040

41-
extern int DefaultXactIsoLevel;
41+
extern PGDLLIMPORT int DefaultXactIsoLevel;
4242
extern PGDLLIMPORT int XactIsoLevel;
4343

4444
/*
@@ -52,18 +52,18 @@ extern PGDLLIMPORT int XactIsoLevel;
5252
#define IsolationIsSerializable() (XactIsoLevel == XACT_SERIALIZABLE)
5353

5454
/* Xact read-only state */
55-
extern bool DefaultXactReadOnly;
56-
extern bool XactReadOnly;
55+
extern PGDLLIMPORT bool DefaultXactReadOnly;
56+
extern PGDLLIMPORT bool XactReadOnly;
5757

5858
/* flag for logging statements in this transaction */
59-
extern bool xact_is_sampled;
59+
extern PGDLLIMPORT bool xact_is_sampled;
6060

6161
/*
6262
* Xact is deferrable -- only meaningful (currently) for read only
6363
* SERIALIZABLE transactions
6464
*/
65-
extern bool DefaultXactDeferrable;
66-
extern bool XactDeferrable;
65+
extern PGDLLIMPORT bool DefaultXactDeferrable;
66+
extern PGDLLIMPORT bool XactDeferrable;
6767

6868
typedef enum
6969
{
@@ -80,7 +80,7 @@ typedef enum
8080
#define SYNCHRONOUS_COMMIT_ON SYNCHRONOUS_COMMIT_REMOTE_FLUSH
8181

8282
/* Synchronous commit level */
83-
extern int synchronous_commit;
83+
extern PGDLLIMPORT int synchronous_commit;
8484

8585
/* used during logical streaming of a transaction */
8686
extern PGDLLIMPORT TransactionId CheckXidAlive;
@@ -93,7 +93,7 @@ extern PGDLLIMPORT bool bsysscan;
9393
* globally accessible, so can be set from anywhere in the code which requires
9494
* recording flags.
9595
*/
96-
extern int MyXactFlags;
96+
extern PGDLLIMPORT int MyXactFlags;
9797

9898
/*
9999
* XACT_FLAGS_ACCESSEDTEMPNAMESPACE - set when a temporary object is accessed.

src/include/access/xlog.h

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@
2424
#define SYNC_METHOD_OPEN 2 /* for O_SYNC */
2525
#define SYNC_METHOD_FSYNC_WRITETHROUGH 3
2626
#define SYNC_METHOD_OPEN_DSYNC 4 /* for O_DSYNC */
27-
extern int sync_method;
27+
extern PGDLLIMPORT int sync_method;
2828

29-
extern XLogRecPtr ProcLastRecPtr;
30-
extern XLogRecPtr XactLastRecEnd;
29+
extern PGDLLIMPORT XLogRecPtr ProcLastRecPtr;
30+
extern PGDLLIMPORT XLogRecPtr XactLastRecEnd;
3131
extern PGDLLIMPORT XLogRecPtr XactLastCommitEnd;
3232

3333
/* these variables are GUC parameters related to XLOG */
34-
extern PGDLLIMPORT int wal_segment_size;
35-
extern int min_wal_size_mb;
36-
extern int max_wal_size_mb;
37-
extern int wal_keep_size_mb;
38-
extern int max_slot_wal_keep_size_mb;
39-
extern int XLOGbuffers;
40-
extern int XLogArchiveTimeout;
41-
extern int wal_retrieve_retry_interval;
42-
extern char *XLogArchiveCommand;
43-
extern bool EnableHotStandby;
44-
extern bool fullPageWrites;
45-
extern bool wal_log_hints;
46-
extern int wal_compression;
47-
extern bool wal_init_zero;
48-
extern bool wal_recycle;
49-
extern bool *wal_consistency_checking;
50-
extern char *wal_consistency_checking_string;
51-
extern bool log_checkpoints;
52-
extern bool track_wal_io_timing;
53-
extern int wal_decode_buffer_size;
54-
55-
extern int CheckPointSegments;
34+
extern PGDLLIMPORT int wal_segment_size;
35+
extern PGDLLIMPORT int min_wal_size_mb;
36+
extern PGDLLIMPORT int max_wal_size_mb;
37+
extern PGDLLIMPORT int wal_keep_size_mb;
38+
extern PGDLLIMPORT int max_slot_wal_keep_size_mb;
39+
extern PGDLLIMPORT int XLOGbuffers;
40+
extern PGDLLIMPORT int XLogArchiveTimeout;
41+
extern PGDLLIMPORT int wal_retrieve_retry_interval;
42+
extern PGDLLIMPORT char *XLogArchiveCommand;
43+
extern PGDLLIMPORT bool EnableHotStandby;
44+
extern PGDLLIMPORT bool fullPageWrites;
45+
extern PGDLLIMPORT bool wal_log_hints;
46+
extern PGDLLIMPORT int wal_compression;
47+
extern PGDLLIMPORT bool wal_init_zero;
48+
extern PGDLLIMPORT bool wal_recycle;
49+
extern PGDLLIMPORT bool *wal_consistency_checking;
50+
extern PGDLLIMPORT char *wal_consistency_checking_string;
51+
extern PGDLLIMPORT bool log_checkpoints;
52+
extern PGDLLIMPORT bool track_wal_io_timing;
53+
extern PGDLLIMPORT int wal_decode_buffer_size;
54+
55+
extern PGDLLIMPORT int CheckPointSegments;
5656

5757
/* Archive modes */
5858
typedef enum ArchiveMode
@@ -61,7 +61,7 @@ typedef enum ArchiveMode
6161
ARCHIVE_MODE_ON, /* enabled while server is running normally */
6262
ARCHIVE_MODE_ALWAYS /* enabled always (even during recovery) */
6363
} ArchiveMode;
64-
extern int XLogArchiveMode;
64+
extern PGDLLIMPORT int XLogArchiveMode;
6565

6666
/* WAL levels */
6767
typedef enum WalLevel
@@ -121,7 +121,7 @@ extern PGDLLIMPORT int wal_level;
121121
#define XLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)
122122

123123
#ifdef WAL_DEBUG
124-
extern bool XLOG_DEBUG;
124+
extern PGDLLIMPORT bool XLOG_DEBUG;
125125
#endif
126126

127127
/*
@@ -175,7 +175,7 @@ typedef struct CheckpointStatsData
175175
* entire sync phase. */
176176
} CheckpointStatsData;
177177

178-
extern CheckpointStatsData CheckpointStats;
178+
extern PGDLLIMPORT CheckpointStatsData CheckpointStats;
179179

180180
/*
181181
* GetWALAvailability return codes

src/include/access/xlog_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ extern void XLogRecGetBlockRefInfo(XLogReaderState *record, bool pretty,
358358
* Exported for the functions in timeline.c and xlogarchive.c. Only valid
359359
* in the startup process.
360360
*/
361-
extern bool ArchiveRecoveryRequested;
362-
extern bool InArchiveRecovery;
363-
extern bool StandbyMode;
364-
extern char *recoveryRestoreCommand;
361+
extern PGDLLIMPORT bool ArchiveRecoveryRequested;
362+
extern PGDLLIMPORT bool InArchiveRecovery;
363+
extern PGDLLIMPORT bool StandbyMode;
364+
extern PGDLLIMPORT char *recoveryRestoreCommand;
365365

366366
#endif /* XLOG_INTERNAL_H */

src/include/access/xlogprefetcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "access/xlogrecord.h"
1919

2020
/* GUCs */
21-
extern int recovery_prefetch;
21+
extern PGDLLIMPORT int recovery_prefetch;
2222

2323
/* Possible values for recovery_prefetch */
2424
typedef enum

0 commit comments

Comments
 (0)