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

Commit774d47b

Browse files
committed
Move all extern declarations for GUC variables to header files
Add extern declarations in appropriate header files for globalvariables related to GUC. In many cases, this was handled quiteinconsistently before, with some GUC variables declared in a headerfile and some only pulled in via ad-hoc extern declarations in various.c files.Also add PGDLLIMPORT qualifications to those variables. These werepreviously missing because src/tools/mark_pgdllimport.pl has only beenused with header files.This also fixes -Wmissing-variable-declarations warnings for GUCvariables (not yet part of the standard warning options).Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
1 parent991f8cf commit774d47b

File tree

12 files changed

+51
-23
lines changed

12 files changed

+51
-23
lines changed

‎src/backend/commands/variable.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,6 @@ assign_session_authorization(const char *newval, void *extra)
901901
* a translation of "none" to InvalidOid. Otherwise this is much like
902902
* SET SESSION AUTHORIZATION.
903903
*/
904-
externchar*role_string;/* in guc_tables.c */
905904

906905
bool
907906
check_role(char**newval,void**extra,GucSourcesource)

‎src/backend/utils/error/elog.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ static void write_syslog(int level, const char *line);
136136
#endif
137137

138138
#ifdefWIN32
139-
externchar*event_source;
140-
141139
staticvoidwrite_eventlog(intlevel,constchar*line,intlen);
142140
#endif
143141

‎src/backend/utils/misc/guc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ char *GUC_check_errmsg_string;
8282
char*GUC_check_errdetail_string;
8383
char*GUC_check_errhint_string;
8484

85-
/* Kluge: for speed, we examine this GUC variable's value directly */
86-
externboolin_hot_standby_guc;
87-
8885

8986
/*
9087
* Unit conversion tables.

‎src/backend/utils/misc/guc_tables.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include"access/xlog_internal.h"
3535
#include"access/xlogprefetcher.h"
3636
#include"access/xlogrecovery.h"
37+
#include"access/xlogutils.h"
3738
#include"archive/archive_module.h"
3839
#include"catalog/namespace.h"
3940
#include"catalog/storage.h"
@@ -71,10 +72,12 @@
7172
#include"replication/slotsync.h"
7273
#include"replication/syncrep.h"
7374
#include"storage/bufmgr.h"
75+
#include"storage/bufpage.h"
7476
#include"storage/large_object.h"
7577
#include"storage/pg_shmem.h"
7678
#include"storage/predicate.h"
7779
#include"storage/standby.h"
80+
#include"tcop/backend_startup.h"
7881
#include"tcop/tcopprot.h"
7982
#include"tsearch/ts_cache.h"
8083
#include"utils/builtins.h"
@@ -90,28 +93,15 @@
9093
#include"utils/rls.h"
9194
#include"utils/xml.h"
9295

96+
#ifdefTRACE_SYNCSCAN
97+
#include"access/syncscan.h"
98+
#endif
99+
93100
/* This value is normally passed in from the Makefile */
94101
#ifndefPG_KRB_SRVTAB
95102
#definePG_KRB_SRVTAB ""
96103
#endif
97104

98-
/* XXX these should appear in other modules' header files */
99-
externboolLog_disconnections;
100-
externboolTrace_connection_negotiation;
101-
externintCommitDelay;
102-
externintCommitSiblings;
103-
externchar*default_tablespace;
104-
externchar*temp_tablespaces;
105-
externboolignore_checksum_failure;
106-
externboolignore_invalid_pages;
107-
108-
#ifdefTRACE_SYNCSCAN
109-
externbooltrace_syncscan;
110-
#endif
111-
#ifdefDEBUG_BOUNDED_SORT
112-
externbooloptimize_bounded_sort;
113-
#endif
114-
115105
/*
116106
* Options for enum values defined in this module.
117107
*

‎src/include/access/syncscan.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#include"storage/block.h"
1818
#include"utils/relcache.h"
1919

20+
/* GUC variables */
21+
#ifdefTRACE_SYNCSCAN
22+
externPGDLLIMPORTbooltrace_syncscan;
23+
#endif
24+
2025
externvoidss_report_location(Relationrel,BlockNumberlocation);
2126
externBlockNumberss_get_location(Relationrel,BlockNumberrelnblocks);
2227
externvoidSyncScanShmemInit(void);

‎src/include/access/xlog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ extern PGDLLIMPORT bool wal_recycle;
5252
externPGDLLIMPORTbool*wal_consistency_checking;
5353
externPGDLLIMPORTchar*wal_consistency_checking_string;
5454
externPGDLLIMPORTboollog_checkpoints;
55+
externPGDLLIMPORTintCommitDelay;
56+
externPGDLLIMPORTintCommitSiblings;
5557
externPGDLLIMPORTbooltrack_wal_io_timing;
5658
externPGDLLIMPORTintwal_decode_buffer_size;
5759

‎src/include/access/xlogutils.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#include"access/xlogreader.h"
1515
#include"storage/bufmgr.h"
1616

17+
/* GUC variable */
18+
externPGDLLIMPORTboolignore_invalid_pages;
19+
1720
/*
1821
* Prior to 8.4, all activity during recovery was carried out by the startup
1922
* process. This local variable continues to be used in many parts of the

‎src/include/commands/tablespace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include"lib/stringinfo.h"
2020
#include"nodes/parsenodes.h"
2121

22+
externPGDLLIMPORTchar*default_tablespace;
23+
externPGDLLIMPORTchar*temp_tablespaces;
2224
externPGDLLIMPORTboolallow_in_place_tablespaces;
2325

2426
/* XLOG stuff */

‎src/include/storage/bufpage.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#include"storage/item.h"
2020
#include"storage/off.h"
2121

22+
/* GUC variable */
23+
externPGDLLIMPORTboolignore_checksum_failure;
24+
2225
/*
2326
* A postgres disk page is an abstraction layered on top of a postgres
2427
* disk block (which is simply a unit of i/o, see block.h).

‎src/include/tcop/backend_startup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#ifndefBACKEND_STARTUP_H
1515
#defineBACKEND_STARTUP_H
1616

17+
/* GUCs */
18+
externPGDLLIMPORTboolTrace_connection_negotiation;
19+
1720
/*
1821
* CAC_state is passed from postmaster to the backend process, to indicate
1922
* whether the connection should be accepted, or if the process should just

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp