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

Commit8518583

Browse files
committed
Provide DLLEXPORT markers for C functions via PG_FUNCTION_INFO_V1 macro.
This isn't really necessary for our own code, because we use a .DEF filein MSVC builds (see gendef.pl), or --export-all-symbols in MinGW andCygwin builds, to ensure that all global symbols in loadable moduleswill be exported on Windows. However, third-party authors might usedifferent build processes that need this marker, and it's harmlessenough for our own builds.To some extent, this is an oversight in commite7128e8, so back-patchto 9.4 where that was added.Laurenz AlbeDiscussion: <A737B7A37273E048B164557ADEF4A58B539300BD@ntex2010a.host.magwien.gv.at>
1 parent64f3524 commit8518583

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/include/fmgr.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,17 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
344344

345345
/*
346346
*Macro to build an info function associated with the given function name.
347-
*Win32 loadable functions usually link with 'dlltool --export-all', but it
348-
*doesn't hurt to add PGDLLIMPORT in case they don't.
347+
*
348+
*As a convenience, also provide an "extern" declaration for the given
349+
*function name, so that writers of C functions need not write that too.
350+
*
351+
*On Windows, the function and info function must be exported. Our normal
352+
*build processes take care of that via .DEF files or --export-all-symbols.
353+
*We add PGDLLEXPORT nonetheless so that C functions built with a
354+
*different build process are guaranteed to be exported.
349355
*/
350356
#definePG_FUNCTION_INFO_V1(funcname) \
351-
Datum funcname(PG_FUNCTION_ARGS); \
357+
extern PGDLLEXPORTDatum funcname(PG_FUNCTION_ARGS); \
352358
extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
353359
const Pg_finfo_record * \
354360
CppConcat(pg_finfo_,funcname) (void) \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp