Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ec5694

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

File tree

100 files changed

+434
-429
lines changed

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
externPGDLLIMPORTintGinFuzzySearchLimit;
71-
externintgin_pending_list_limit;
71+
externPGDLLIMPORTintgin_pending_list_limit;
7272

7373
/* ginutil.c */
7474
externvoidginGetStats(Relationindex,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-
externvolatileboolParallelMessagePending;
57+
externPGDLLIMPORTvolatileboolParallelMessagePending;
5858
externPGDLLIMPORTintParallelWorkerNumber;
5959
externPGDLLIMPORTboolInitializingParallelWorker;
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
externvoidDetachSession(void);
4040

4141
/* The current session, or NULL for none. */
42-
externSession*CurrentSession;
42+
externPGDLLIMPORTSession*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
#defineDEFAULT_TABLE_ACCESS_METHOD"heap"
2929

3030
/* GUCs */
31-
externchar*default_table_access_method;
32-
externboolsynchronize_seqscans;
31+
externPGDLLIMPORTchar*default_table_access_method;
32+
externPGDLLIMPORTboolsynchronize_seqscans;
3333

3434

3535
structBulkInsertStateData;

‎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-
externintdefault_toast_compression;
23+
externPGDLLIMPORTintdefault_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
#defineTWOPHASE_RM_PREDICATELOCK_ID4
2929
#defineTWOPHASE_RM_MAX_IDTWOPHASE_RM_PREDICATELOCK_ID
3030

31-
externconstTwoPhaseCallbacktwophase_recover_callbacks[];
32-
externconstTwoPhaseCallbacktwophase_postcommit_callbacks[];
33-
externconstTwoPhaseCallbacktwophase_postabort_callbacks[];
34-
externconstTwoPhaseCallbacktwophase_standby_recover_callbacks[];
31+
externPGDLLIMPORTconstTwoPhaseCallbacktwophase_recover_callbacks[];
32+
externPGDLLIMPORTconstTwoPhaseCallbacktwophase_postcommit_callbacks[];
33+
externPGDLLIMPORTconstTwoPhaseCallbacktwophase_postabort_callbacks[];
34+
externPGDLLIMPORTconstTwoPhaseCallbacktwophase_standby_recover_callbacks[];
3535

3636

3737
externvoidRegisterTwoPhaseRecord(TwoPhaseRmgrIdrmid,uint16info,

‎src/include/access/xact.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#defineXACT_REPEATABLE_READ2
3939
#defineXACT_SERIALIZABLE3
4040

41-
externintDefaultXactIsoLevel;
41+
externPGDLLIMPORTintDefaultXactIsoLevel;
4242
externPGDLLIMPORTintXactIsoLevel;
4343

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

5454
/* Xact read-only state */
55-
externboolDefaultXactReadOnly;
56-
externboolXactReadOnly;
55+
externPGDLLIMPORTboolDefaultXactReadOnly;
56+
externPGDLLIMPORTboolXactReadOnly;
5757

5858
/* flag for logging statements in this transaction */
59-
externboolxact_is_sampled;
59+
externPGDLLIMPORTboolxact_is_sampled;
6060

6161
/*
6262
* Xact is deferrable -- only meaningful (currently) for read only
6363
* SERIALIZABLE transactions
6464
*/
65-
externboolDefaultXactDeferrable;
66-
externboolXactDeferrable;
65+
externPGDLLIMPORTboolDefaultXactDeferrable;
66+
externPGDLLIMPORTboolXactDeferrable;
6767

6868
typedefenum
6969
{
@@ -80,7 +80,7 @@ typedef enum
8080
#defineSYNCHRONOUS_COMMIT_ONSYNCHRONOUS_COMMIT_REMOTE_FLUSH
8181

8282
/* Synchronous commit level */
83-
externintsynchronous_commit;
83+
externPGDLLIMPORTintsynchronous_commit;
8484

8585
/* used during logical streaming of a transaction */
8686
externPGDLLIMPORTTransactionIdCheckXidAlive;
@@ -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-
externintMyXactFlags;
96+
externPGDLLIMPORTintMyXactFlags;
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
#defineSYNC_METHOD_OPEN2/* for O_SYNC */
2525
#defineSYNC_METHOD_FSYNC_WRITETHROUGH3
2626
#defineSYNC_METHOD_OPEN_DSYNC4/* for O_DSYNC */
27-
externintsync_method;
27+
externPGDLLIMPORTintsync_method;
2828

29-
externXLogRecPtrProcLastRecPtr;
30-
externXLogRecPtrXactLastRecEnd;
29+
externPGDLLIMPORTXLogRecPtrProcLastRecPtr;
30+
externPGDLLIMPORTXLogRecPtrXactLastRecEnd;
3131
externPGDLLIMPORTXLogRecPtrXactLastCommitEnd;
3232

3333
/* these variables are GUC parameters related to XLOG */
34-
externPGDLLIMPORTintwal_segment_size;
35-
externintmin_wal_size_mb;
36-
externintmax_wal_size_mb;
37-
externintwal_keep_size_mb;
38-
externintmax_slot_wal_keep_size_mb;
39-
externintXLOGbuffers;
40-
externintXLogArchiveTimeout;
41-
externintwal_retrieve_retry_interval;
42-
externchar*XLogArchiveCommand;
43-
externboolEnableHotStandby;
44-
externboolfullPageWrites;
45-
externboolwal_log_hints;
46-
externintwal_compression;
47-
externboolwal_init_zero;
48-
externboolwal_recycle;
49-
externbool*wal_consistency_checking;
50-
externchar*wal_consistency_checking_string;
51-
externboollog_checkpoints;
52-
externbooltrack_wal_io_timing;
53-
externintwal_decode_buffer_size;
54-
55-
externintCheckPointSegments;
34+
externPGDLLIMPORTintwal_segment_size;
35+
externPGDLLIMPORTintmin_wal_size_mb;
36+
externPGDLLIMPORTintmax_wal_size_mb;
37+
externPGDLLIMPORTintwal_keep_size_mb;
38+
externPGDLLIMPORTintmax_slot_wal_keep_size_mb;
39+
externPGDLLIMPORTintXLOGbuffers;
40+
externPGDLLIMPORTintXLogArchiveTimeout;
41+
externPGDLLIMPORTintwal_retrieve_retry_interval;
42+
externPGDLLIMPORTchar*XLogArchiveCommand;
43+
externPGDLLIMPORTboolEnableHotStandby;
44+
externPGDLLIMPORTboolfullPageWrites;
45+
externPGDLLIMPORTboolwal_log_hints;
46+
externPGDLLIMPORTintwal_compression;
47+
externPGDLLIMPORTboolwal_init_zero;
48+
externPGDLLIMPORTboolwal_recycle;
49+
externPGDLLIMPORTbool*wal_consistency_checking;
50+
externPGDLLIMPORTchar*wal_consistency_checking_string;
51+
externPGDLLIMPORTboollog_checkpoints;
52+
externPGDLLIMPORTbooltrack_wal_io_timing;
53+
externPGDLLIMPORTintwal_decode_buffer_size;
54+
55+
externPGDLLIMPORTintCheckPointSegments;
5656

5757
/* Archive modes */
5858
typedefenumArchiveMode
@@ -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-
externintXLogArchiveMode;
64+
externPGDLLIMPORTintXLogArchiveMode;
6565

6666
/* WAL levels */
6767
typedefenumWalLevel
@@ -121,7 +121,7 @@ extern PGDLLIMPORT int wal_level;
121121
#defineXLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)
122122

123123
#ifdefWAL_DEBUG
124-
externboolXLOG_DEBUG;
124+
externPGDLLIMPORTboolXLOG_DEBUG;
125125
#endif
126126

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

178-
externCheckpointStatsDataCheckpointStats;
178+
externPGDLLIMPORTCheckpointStatsDataCheckpointStats;
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-
externboolArchiveRecoveryRequested;
362-
externboolInArchiveRecovery;
363-
externboolStandbyMode;
364-
externchar*recoveryRestoreCommand;
361+
externPGDLLIMPORTboolArchiveRecoveryRequested;
362+
externPGDLLIMPORTboolInArchiveRecovery;
363+
externPGDLLIMPORTboolStandbyMode;
364+
externPGDLLIMPORTchar*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-
externintrecovery_prefetch;
21+
externPGDLLIMPORTintrecovery_prefetch;
2222

2323
/* Possible values for recovery_prefetch */
2424
typedefenum

‎src/include/access/xlogrecovery.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@ typedef enum RecoveryPauseState
4949
}RecoveryPauseState;
5050

5151
/* User-settable GUC parameters */
52-
externboolrecoveryTargetInclusive;
53-
externintrecoveryTargetAction;
54-
externintrecovery_min_apply_delay;
55-
externchar*PrimaryConnInfo;
56-
externchar*PrimarySlotName;
57-
externchar*recoveryRestoreCommand;
58-
externchar*recoveryEndCommand;
59-
externchar*archiveCleanupCommand;
52+
externPGDLLIMPORTboolrecoveryTargetInclusive;
53+
externPGDLLIMPORTintrecoveryTargetAction;
54+
externPGDLLIMPORTintrecovery_min_apply_delay;
55+
externPGDLLIMPORTchar*PrimaryConnInfo;
56+
externPGDLLIMPORTchar*PrimarySlotName;
57+
externPGDLLIMPORTchar*recoveryRestoreCommand;
58+
externPGDLLIMPORTchar*recoveryEndCommand;
59+
externPGDLLIMPORTchar*archiveCleanupCommand;
6060

6161
/* indirectly set via GUC system */
62-
externTransactionIdrecoveryTargetXid;
63-
externchar*recovery_target_time_string;
64-
externTimestampTzrecoveryTargetTime;
65-
externconstchar*recoveryTargetName;
66-
externXLogRecPtrrecoveryTargetLSN;
67-
externRecoveryTargetTyperecoveryTarget;
68-
externchar*PromoteTriggerFile;
69-
externboolwal_receiver_create_temp_slot;
70-
externRecoveryTargetTimeLineGoalrecoveryTargetTimeLineGoal;
71-
externTimeLineIDrecoveryTargetTLIRequested;
72-
externTimeLineIDrecoveryTargetTLI;
62+
externPGDLLIMPORTTransactionIdrecoveryTargetXid;
63+
externPGDLLIMPORTchar*recovery_target_time_string;
64+
externPGDLLIMPORTTimestampTzrecoveryTargetTime;
65+
externPGDLLIMPORTconstchar*recoveryTargetName;
66+
externPGDLLIMPORTXLogRecPtrrecoveryTargetLSN;
67+
externPGDLLIMPORTRecoveryTargetTyperecoveryTarget;
68+
externPGDLLIMPORTchar*PromoteTriggerFile;
69+
externPGDLLIMPORTboolwal_receiver_create_temp_slot;
70+
externPGDLLIMPORTRecoveryTargetTimeLineGoalrecoveryTargetTimeLineGoal;
71+
externPGDLLIMPORTTimeLineIDrecoveryTargetTLIRequested;
72+
externPGDLLIMPORTTimeLineIDrecoveryTargetTLI;
7373

7474
/* Have we already reached a consistent database state? */
75-
externboolreachedConsistency;
75+
externPGDLLIMPORTboolreachedConsistency;
7676

7777
/* Are we currently in standby mode? */
78-
externboolStandbyMode;
78+
externPGDLLIMPORTboolStandbyMode;
7979

8080
externSizeXLogRecoveryShmemSize(void);
8181
externvoidXLogRecoveryShmemInit(void);

‎src/include/access/xlogutils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* potentially perform work during recovery should check RecoveryInProgress().
2222
* See XLogCtl notes in xlog.c.
2323
*/
24-
externboolInRecovery;
24+
externPGDLLIMPORTboolInRecovery;
2525

2626
/*
2727
* Like InRecovery, standbyState is only valid in the startup process.
@@ -52,7 +52,7 @@ typedef enum
5252
STANDBY_SNAPSHOT_READY
5353
}HotStandbyState;
5454

55-
externHotStandbyStatestandbyState;
55+
externPGDLLIMPORTHotStandbyStatestandbyState;
5656

5757
#defineInHotStandby (standbyState >= STANDBY_SNAPSHOT_PENDING)
5858

‎src/include/bootstrap/bootstrap.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#defineBOOTCOL_NULL_FORCE_NULL2
2828
#defineBOOTCOL_NULL_FORCE_NOT_NULL 3
2929

30-
externRelationboot_reldesc;
31-
externForm_pg_attributeattrtypes[MAXATTR];
32-
externintnumattr;
30+
externPGDLLIMPORTRelationboot_reldesc;
31+
externPGDLLIMPORTForm_pg_attributeattrtypes[MAXATTR];
32+
externPGDLLIMPORTintnumattr;
3333

3434

3535
externvoidBootstrapModeMain(intargc,char*argv[],boolcheck_only)pg_attribute_noreturn();

‎src/include/catalog/namespace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ extern void AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid,
182182
SubTransactionIdparentSubid);
183183

184184
/* stuff for search_path GUC variable */
185-
externchar*namespace_search_path;
185+
externPGDLLIMPORTchar*namespace_search_path;
186186

187187
externList*fetch_search_path(boolincludeImplicit);
188188
externintfetch_search_path_array(Oid*sarray,intsarray_len);

‎src/include/catalog/objectaddress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ typedef struct ObjectAddress
2828
int32objectSubId;/* Subitem within object (eg column), or 0 */
2929
}ObjectAddress;
3030

31-
externconstObjectAddressInvalidObjectAddress;
31+
externPGDLLIMPORTconstObjectAddressInvalidObjectAddress;
3232

3333
#defineObjectAddressSubSet(addr,class_id,object_id,object_sub_id) \
3434
do { \

‎src/include/catalog/storage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include"utils/relcache.h"
2121

2222
/* GUC variables */
23-
externintwal_skip_threshold;
23+
externPGDLLIMPORTintwal_skip_threshold;
2424

2525
externSMgrRelationRelationCreateStorage(RelFileNodernode,
2626
charrelpersistence,

‎src/include/commands/async.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*/
2121
#defineNUM_NOTIFY_BUFFERS8
2222

23-
externboolTrace_notify;
24-
externvolatilesig_atomic_tnotifyInterruptPending;
23+
externPGDLLIMPORTboolTrace_notify;
24+
externPGDLLIMPORTvolatilesig_atomic_tnotifyInterruptPending;
2525

2626
externSizeAsyncShmemSize(void);
2727
externvoidAsyncShmemInit(void);

‎src/include/commands/tablespace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include"lib/stringinfo.h"
2020
#include"nodes/parsenodes.h"
2121

22-
externboolallow_in_place_tablespaces;
22+
externPGDLLIMPORTboolallow_in_place_tablespaces;
2323

2424
/* XLOG stuff */
2525
#defineXLOG_TBLSPC_CREATE0x00

‎src/include/commands/user.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include"parser/parse_node.h"
1818

1919
/* GUC. Is actually of type PasswordType. */
20-
externintPassword_encryption;
20+
externPGDLLIMPORTintPassword_encryption;
2121

2222
/* Hook to check passwords in CreateRole() and AlterRole() */
2323
typedefvoid (*check_password_hook_type) (constchar*username,constchar*shadow_pass,PasswordTypepassword_type,Datumvaliduntil_time,boolvaliduntil_null);

‎src/include/commands/vacuum.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,17 +252,17 @@ typedef struct VacDeadItems
252252

253253
/* GUC parameters */
254254
externPGDLLIMPORTintdefault_statistics_target;/* PGDLLIMPORT for PostGIS */
255-
externintvacuum_freeze_min_age;
256-
externintvacuum_freeze_table_age;
257-
externintvacuum_multixact_freeze_min_age;
258-
externintvacuum_multixact_freeze_table_age;
259-
externintvacuum_failsafe_age;
260-
externintvacuum_multixact_failsafe_age;
255+
externPGDLLIMPORTintvacuum_freeze_min_age;
256+
externPGDLLIMPORTintvacuum_freeze_table_age;
257+
externPGDLLIMPORTintvacuum_multixact_freeze_min_age;
258+
externPGDLLIMPORTintvacuum_multixact_freeze_table_age;
259+
externPGDLLIMPORTintvacuum_failsafe_age;
260+
externPGDLLIMPORTintvacuum_multixact_failsafe_age;
261261

262262
/* Variables for cost-based parallel vacuum */
263-
externpg_atomic_uint32*VacuumSharedCostBalance;
264-
externpg_atomic_uint32*VacuumActiveNWorkers;
265-
externintVacuumCostBalanceLocal;
263+
externPGDLLIMPORTpg_atomic_uint32*VacuumSharedCostBalance;
264+
externPGDLLIMPORTpg_atomic_uint32*VacuumActiveNWorkers;
265+
externPGDLLIMPORTintVacuumCostBalanceLocal;
266266

267267

268268
/* in commands/vacuum.c */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp