Skip to content

Commit 5edeb57

Browse files
committed
Add some missing PGDLLIMPORT markings
Three variables in pqsignal.h (UnBlockSig, BlockSig and StartupBlockSig) were not marked with PGDLLIMPORT, as they are declared in a way that prevents mark_pgdllimport.pl to detect them. These variables are redefined in a style more consistent with the other headers, allowing the script to find and mark them. PGDLLIMPORT was missing for __pg_log_level in logging.h, so add it back. The marking got accidentally removed in 9a374b7, just after its addition in 8ec5694. While on it, add a comment in mark_pgdllimport.pl explaining what are the arguments needed by the script (aka a list of header paths). Reported-by: Andres Freund Discussion: https://postgr.es/m/20220506234924.6mxxotl3xl63db3l@alap3.anarazel.de
1 parent 6bfecf3 commit 5edeb57

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/include/common/logging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum pg_log_level
5151
/*
5252
* __pg_log_level is the minimum log level that will actually be shown.
5353
*/
54-
extern enum pg_log_level __pg_log_level;
54+
extern PGDLLIMPORT enum pg_log_level __pg_log_level;
5555

5656
/*
5757
* A log message can have several parts. The primary message is required,

src/include/libpq/pqsignal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ extern int pqsigsetmask(int mask);
3030
#define sigdelset(set, signum) (*(set) &= ~(sigmask(signum)))
3131
#endif /* WIN32 */
3232

33-
extern sigset_t UnBlockSig,
34-
BlockSig,
35-
StartupBlockSig;
33+
extern PGDLLIMPORT sigset_t UnBlockSig;
34+
extern PGDLLIMPORT sigset_t BlockSig;
35+
extern PGDLLIMPORT sigset_t StartupBlockSig;
3636

3737
extern void pqinitmask(void);
3838

src/tools/mark_pgdllimport.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# smart and may not catch all cases.
1313
#
1414
# It's probably a good idea to run pgindent on any files that this
15-
# script modifies before committing.
15+
# script modifies before committing. This script uses as arguments
16+
# a list of the header files to scan for the markings.
1617
#
1718
# Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
1819
# Portions Copyright (c) 1994, Regents of the University of California

0 commit comments

Comments
 (0)