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

Commitf2b73c8

Browse files
committed
Add central declarations for dlsym()ed symbols
This is in preparation for defaulting to -fvisibility=hidden in extensions,instead of exporting all symbols. For that symbols intended to be exportedneed to be tagged with PGDLLEXPORT. Most extensions only need to do so for_PG_init() and functions defined with PG_FUNCTION_INFO_V1. Adding centraldeclarations avoids each extension having to add PGDLLEXPORT. Any existingdeclarations in extensions will continue to work if fmgr.h is included beforethem, otherwise compilation for Windows will fail.Author: Andres Freund <andres@anarazel.de>Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/20211101020311.av6hphdl6xbjbuif@alap3.anarazel.de
1 parent31e5b50 commitf2b73c8

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

‎src/include/fmgr.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,17 @@ CppConcat(pg_finfo_,funcname) (void) \
424424
extern int no_such_variable
425425

426426

427+
/*
428+
* Declare _PG_init/_PG_fini centrally. Historically each shared library had
429+
* its own declaration; but now that we want to mark these PGDLLEXPORT, using
430+
* central declarations avoids each extension having to add that. Any
431+
* existing declarations in extensions will continue to work if fmgr.h is
432+
* included before them, otherwise compilation for Windows will fail.
433+
*/
434+
externPGDLLEXPORTvoid_PG_init(void);
435+
externPGDLLEXPORTvoid_PG_fini(void);
436+
437+
427438
/*-------------------------------------------------------------------------
428439
*Support for verifying backend compatibility of loaded modules
429440
*

‎src/include/jit/jit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ typedef struct JitContext
6363

6464
typedefstructJitProviderCallbacksJitProviderCallbacks;
6565

66-
externvoid_PG_jit_provider_init(JitProviderCallbacks*cb);
66+
externPGDLLEXPORTvoid_PG_jit_provider_init(JitProviderCallbacks*cb);
6767
typedefvoid (*JitProviderInit) (JitProviderCallbacks*cb);
6868
typedefvoid (*JitProviderResetAfterErrorCB) (void);
6969
typedefvoid (*JitProviderReleaseContextCB) (JitContext*context);

‎src/include/postmaster/pgarch.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ typedef struct ArchiveModuleCallbacks
6363
*/
6464
typedefvoid (*ArchiveModuleInit) (ArchiveModuleCallbacks*cb);
6565

66+
externPGDLLEXPORTvoid_PG_archive_module_init(ArchiveModuleCallbacks*cb);
67+
6668
/*
6769
* Since the logic for archiving via a shell command is in the core server
6870
* and does not need to be loaded via a shared library, it has a special

‎src/include/replication/output_plugin.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ typedef struct OutputPluginOptions
3535
*/
3636
typedefvoid (*LogicalOutputPluginInit) (structOutputPluginCallbacks*cb);
3737

38+
externPGDLLEXPORTvoid_PG_output_plugin_init(structOutputPluginCallbacks*cb);
39+
3840
/*
3941
* Callback that gets called in a user-defined plugin. ctx->private_data can
4042
* be set to some private data.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp