mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Provide DLLEXPORT markers for C functions via PG_FUNCTION_INFO_V1 macro.
Second try at the change originally made in commit 8518583cd; this time with contrib updates so that manual extern declarations are also marked with PGDLLEXPORT. The release notes should point this out as a significant source-code change for extension authors, since they'll have to make similar additions to avoid trouble on Windows. Laurenz Albe, doc change by me Patch: <A737B7A37273E048B164557ADEF4A58B53962ED8@ntex2010a.host.magwien.gv.at>
This commit is contained in:
@ -2577,6 +2577,23 @@ concat_text(PG_FUNCTION_ARGS)
|
||||
error messages to this effect.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
To work correctly on Windows, <literal>C</>-language functions need
|
||||
to be marked with <literal>PGDLLEXPORT</>, unless you use a build
|
||||
process that marks all global functions that way. In simple cases
|
||||
this detail will be handled transparently by
|
||||
the <literal>PG_FUNCTION_INFO_V1</> macro. However, if you write
|
||||
explicit external declarations (perhaps in header files), be sure
|
||||
to write them like this:
|
||||
<programlisting>
|
||||
extern PGDLLEXPORT Datum funcname(PG_FUNCTION_ARGS);
|
||||
</programlisting>
|
||||
or you'll get compiler complaints when building on Windows. (On
|
||||
other platforms, the <literal>PGDLLEXPORT</> macro does nothing.)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</sect2>
|
||||
|
Reference in New Issue
Block a user