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

Commit33cb96b

Browse files
committed
Revert "Provide DLLEXPORT markers for C functions via PG_FUNCTION_INFO_V1 macro."
This reverts commitc8ead2a.Seems there is no way to do this that doesn't cause MSVC to givewarnings, so let's just go back to the way we've been doing it.Discussion: <11843.1478358206@sss.pgh.pa.us>
1 parent77517ba commit33cb96b

File tree

4 files changed

+25
-41
lines changed

4 files changed

+25
-41
lines changed

‎contrib/hstore/hstore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
194194
#ifHSTORE_POLLUTE_NAMESPACE
195195
#defineHSTORE_POLLUTE(newname_,oldname_) \
196196
PG_FUNCTION_INFO_V1(oldname_); \
197-
extern PGDLLEXPORTDatum newname_(PG_FUNCTION_ARGS); \
197+
Datum newname_(PG_FUNCTION_ARGS); \
198198
Datum oldname_(PG_FUNCTION_ARGS) { return newname_(fcinfo); } \
199199
extern int no_such_variable
200200
#else

‎contrib/ltree/ltree.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,30 @@ typedef struct
130130

131131

132132
/* use in array iterator */
133-
externPGDLLEXPORTDatumltree_isparent(PG_FUNCTION_ARGS);
134-
externPGDLLEXPORTDatumltree_risparent(PG_FUNCTION_ARGS);
135-
externPGDLLEXPORTDatumltq_regex(PG_FUNCTION_ARGS);
136-
externPGDLLEXPORTDatumltq_rregex(PG_FUNCTION_ARGS);
137-
externPGDLLEXPORTDatumlt_q_regex(PG_FUNCTION_ARGS);
138-
externPGDLLEXPORTDatumlt_q_rregex(PG_FUNCTION_ARGS);
139-
externPGDLLEXPORTDatumltxtq_exec(PG_FUNCTION_ARGS);
140-
externPGDLLEXPORTDatumltxtq_rexec(PG_FUNCTION_ARGS);
141-
externPGDLLEXPORTDatum_ltq_regex(PG_FUNCTION_ARGS);
142-
externPGDLLEXPORTDatum_ltq_rregex(PG_FUNCTION_ARGS);
143-
externPGDLLEXPORTDatum_lt_q_regex(PG_FUNCTION_ARGS);
144-
externPGDLLEXPORTDatum_lt_q_rregex(PG_FUNCTION_ARGS);
145-
externPGDLLEXPORTDatum_ltxtq_exec(PG_FUNCTION_ARGS);
146-
externPGDLLEXPORTDatum_ltxtq_rexec(PG_FUNCTION_ARGS);
147-
externPGDLLEXPORTDatum_ltree_isparent(PG_FUNCTION_ARGS);
148-
externPGDLLEXPORTDatum_ltree_risparent(PG_FUNCTION_ARGS);
133+
Datumltree_isparent(PG_FUNCTION_ARGS);
134+
Datumltree_risparent(PG_FUNCTION_ARGS);
135+
Datumltq_regex(PG_FUNCTION_ARGS);
136+
Datumltq_rregex(PG_FUNCTION_ARGS);
137+
Datumlt_q_regex(PG_FUNCTION_ARGS);
138+
Datumlt_q_rregex(PG_FUNCTION_ARGS);
139+
Datumltxtq_exec(PG_FUNCTION_ARGS);
140+
Datumltxtq_rexec(PG_FUNCTION_ARGS);
141+
Datum_ltq_regex(PG_FUNCTION_ARGS);
142+
Datum_ltq_rregex(PG_FUNCTION_ARGS);
143+
Datum_lt_q_regex(PG_FUNCTION_ARGS);
144+
Datum_lt_q_rregex(PG_FUNCTION_ARGS);
145+
Datum_ltxtq_exec(PG_FUNCTION_ARGS);
146+
Datum_ltxtq_rexec(PG_FUNCTION_ARGS);
147+
Datum_ltree_isparent(PG_FUNCTION_ARGS);
148+
Datum_ltree_risparent(PG_FUNCTION_ARGS);
149149

150150
/* Concatenation functions */
151-
externPGDLLEXPORTDatumltree_addltree(PG_FUNCTION_ARGS);
152-
externPGDLLEXPORTDatumltree_addtext(PG_FUNCTION_ARGS);
153-
externPGDLLEXPORTDatumltree_textadd(PG_FUNCTION_ARGS);
151+
Datumltree_addltree(PG_FUNCTION_ARGS);
152+
Datumltree_addtext(PG_FUNCTION_ARGS);
153+
Datumltree_textadd(PG_FUNCTION_ARGS);
154154

155155
/* Util function */
156-
externPGDLLEXPORTDatumltree_in(PG_FUNCTION_ARGS);
156+
Datumltree_in(PG_FUNCTION_ARGS);
157157

158158
boolltree_execute(ITEM*curitem,void*checkval,
159159
boolcalcnot,bool (*chkcond) (void*checkval,ITEM*val));

‎doc/src/sgml/xfunc.sgml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2577,23 +2577,6 @@ concat_text(PG_FUNCTION_ARGS)
25772577
error messages to this effect.
25782578
</para>
25792579
</listitem>
2580-
2581-
<listitem>
2582-
<para>
2583-
To work correctly on Windows, <literal>C</>-language functions need
2584-
to be marked with <literal>PGDLLEXPORT</>, unless you use a build
2585-
process that marks all global functions that way. In simple cases
2586-
this detail will be handled transparently by
2587-
the <literal>PG_FUNCTION_INFO_V1</> macro. However, if you write
2588-
explicit external declarations (perhaps in header files), be sure
2589-
to write them like this:
2590-
<programlisting>
2591-
extern PGDLLEXPORT Datum funcname(PG_FUNCTION_ARGS);
2592-
</programlisting>
2593-
or you'll get compiler complaints when building on Windows. (On
2594-
other platforms, the <literal>PGDLLEXPORT</> macro does nothing.)
2595-
</para>
2596-
</listitem>
25972580
</itemizedlist>
25982581
</para>
25992582
</sect2>

‎src/include/fmgr.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,12 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
350350
*
351351
*On Windows, the function and info function must be exported. Our normal
352352
*build processes take care of that via .DEF files or --export-all-symbols.
353-
*Module authors using a different build process might do it differently,
354-
*so we declare these functions PGDLLEXPORT for their convenience.
353+
*Module authors using a different build process might need to manually
354+
*declare the function PGDLLEXPORT. We do that automatically here for the
355+
*info function, since authors shouldn't need to be explicitly aware of it.
355356
*/
356357
#definePG_FUNCTION_INFO_V1(funcname) \
357-
externPGDLLEXPORTDatum funcname(PG_FUNCTION_ARGS); \
358+
extern Datum funcname(PG_FUNCTION_ARGS); \
358359
extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
359360
const Pg_finfo_record * \
360361
CppConcat(pg_finfo_,funcname) (void) \

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp