Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cf64d3

Browse files
committed
Mark all symbols exported from extension libraries PGDLLEXPORT.
This is in preparation for defaulting to -fvisibility=hidden in extensions, instead of relying on all symbols in extensions to be exported. This should have been committed before 089480c, but something in my commit scripts went wrong. Author: Andres Freund <[email protected]> Reviewed-By: Tom Lane <[email protected]> Discussion: https://postgr.es/m/[email protected]
1 parent 5050fe5 commit 8cf64d3

File tree

8 files changed

+58
-58
lines changed

8 files changed

+58
-58
lines changed

contrib/hstore/hstore.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ typedef struct
147147
} while (0)
148148

149149
/* DatumGetHStoreP includes support for reading old-format hstore values */
150-
extern HStore *hstoreUpgrade(Datum orig);
150+
extern PGDLLEXPORT HStore *hstoreUpgrade(Datum orig);
151151

152152
#define DatumGetHStoreP(d) hstoreUpgrade(d)
153153

@@ -168,14 +168,14 @@ typedef struct
168168
bool needfree; /* need to pfree the value? */
169169
} Pairs;
170170

171-
extern int hstoreUniquePairs(Pairs *a, int32 l, int32 *buflen);
172-
extern HStore *hstorePairs(Pairs *pairs, int32 pcount, int32 buflen);
171+
extern PGDLLEXPORT int hstoreUniquePairs(Pairs *a, int32 l, int32 *buflen);
172+
extern PGDLLEXPORT HStore *hstorePairs(Pairs *pairs, int32 pcount, int32 buflen);
173173

174-
extern size_t hstoreCheckKeyLen(size_t len);
175-
extern size_t hstoreCheckValLen(size_t len);
174+
extern PGDLLEXPORT size_t hstoreCheckKeyLen(size_t len);
175+
extern PGDLLEXPORT size_t hstoreCheckValLen(size_t len);
176176

177-
extern int hstoreFindKey(HStore *hs, int *lowbound, char *key, int keylen);
178-
extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
177+
extern PGDLLEXPORT int hstoreFindKey(HStore *hs, int *lowbound, char *key, int keylen);
178+
extern PGDLLEXPORT Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
179179

180180
#define HStoreContainsStrategyNumber 7
181181
#define HStoreExistsStrategyNumber 9
@@ -194,7 +194,7 @@ extern Pairs *hstoreArrayToPairs(ArrayType *a, int *npairs);
194194
#if HSTORE_POLLUTE_NAMESPACE
195195
#define HSTORE_POLLUTE(newname_,oldname_) \
196196
PG_FUNCTION_INFO_V1(oldname_); \
197-
Datum newname_(PG_FUNCTION_ARGS); \
197+
extern PGDLLEXPORT 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
@@ -176,30 +176,30 @@ typedef struct
176176

177177

178178
/* use in array iterator */
179-
Datum ltree_isparent(PG_FUNCTION_ARGS);
180-
Datum ltree_risparent(PG_FUNCTION_ARGS);
181-
Datum ltq_regex(PG_FUNCTION_ARGS);
182-
Datum ltq_rregex(PG_FUNCTION_ARGS);
183-
Datum lt_q_regex(PG_FUNCTION_ARGS);
184-
Datum lt_q_rregex(PG_FUNCTION_ARGS);
185-
Datum ltxtq_exec(PG_FUNCTION_ARGS);
186-
Datum ltxtq_rexec(PG_FUNCTION_ARGS);
187-
Datum _ltq_regex(PG_FUNCTION_ARGS);
188-
Datum _ltq_rregex(PG_FUNCTION_ARGS);
189-
Datum _lt_q_regex(PG_FUNCTION_ARGS);
190-
Datum _lt_q_rregex(PG_FUNCTION_ARGS);
191-
Datum _ltxtq_exec(PG_FUNCTION_ARGS);
192-
Datum _ltxtq_rexec(PG_FUNCTION_ARGS);
193-
Datum _ltree_isparent(PG_FUNCTION_ARGS);
194-
Datum _ltree_risparent(PG_FUNCTION_ARGS);
179+
PGDLLEXPORT Datum ltree_isparent(PG_FUNCTION_ARGS);
180+
PGDLLEXPORT Datum ltree_risparent(PG_FUNCTION_ARGS);
181+
PGDLLEXPORT Datum ltq_regex(PG_FUNCTION_ARGS);
182+
PGDLLEXPORT Datum ltq_rregex(PG_FUNCTION_ARGS);
183+
PGDLLEXPORT Datum lt_q_regex(PG_FUNCTION_ARGS);
184+
PGDLLEXPORT Datum lt_q_rregex(PG_FUNCTION_ARGS);
185+
PGDLLEXPORT Datum ltxtq_exec(PG_FUNCTION_ARGS);
186+
PGDLLEXPORT Datum ltxtq_rexec(PG_FUNCTION_ARGS);
187+
PGDLLEXPORT Datum _ltq_regex(PG_FUNCTION_ARGS);
188+
PGDLLEXPORT Datum _ltq_rregex(PG_FUNCTION_ARGS);
189+
PGDLLEXPORT Datum _lt_q_regex(PG_FUNCTION_ARGS);
190+
PGDLLEXPORT Datum _lt_q_rregex(PG_FUNCTION_ARGS);
191+
PGDLLEXPORT Datum _ltxtq_exec(PG_FUNCTION_ARGS);
192+
PGDLLEXPORT Datum _ltxtq_rexec(PG_FUNCTION_ARGS);
193+
PGDLLEXPORT Datum _ltree_isparent(PG_FUNCTION_ARGS);
194+
PGDLLEXPORT Datum _ltree_risparent(PG_FUNCTION_ARGS);
195195

196196
/* Concatenation functions */
197-
Datum ltree_addltree(PG_FUNCTION_ARGS);
198-
Datum ltree_addtext(PG_FUNCTION_ARGS);
199-
Datum ltree_textadd(PG_FUNCTION_ARGS);
197+
PGDLLEXPORT Datum ltree_addltree(PG_FUNCTION_ARGS);
198+
PGDLLEXPORT Datum ltree_addtext(PG_FUNCTION_ARGS);
199+
PGDLLEXPORT Datum ltree_textadd(PG_FUNCTION_ARGS);
200200

201201
/* Util function */
202-
Datum ltree_in(PG_FUNCTION_ARGS);
202+
PGDLLEXPORT Datum ltree_in(PG_FUNCTION_ARGS);
203203

204204
bool ltree_execute(ITEM *curitem, void *checkval,
205205
bool calcnot, bool (*chkcond) (void *checkval, ITEM *val));

src/include/fmgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ typedef const Pg_finfo_record *(*PGFInfoFunction) (void);
413413
* info function, since authors shouldn't need to be explicitly aware of it.
414414
*/
415415
#define PG_FUNCTION_INFO_V1(funcname) \
416-
extern Datum funcname(PG_FUNCTION_ARGS); \
416+
extern PGDLLEXPORT Datum funcname(PG_FUNCTION_ARGS); \
417417
extern PGDLLEXPORT const Pg_finfo_record * CppConcat(pg_finfo_,funcname)(void); \
418418
const Pg_finfo_record * \
419419
CppConcat(pg_finfo_,funcname) (void) \

src/pl/plpython/plpy_elog.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ extern PyObject *PLy_exc_spi_error;
3434
} while(0)
3535
#endif /* HAVE__BUILTIN_CONSTANT_P */
3636

37-
extern void PLy_elog_impl(int elevel, const char *fmt,...) pg_attribute_printf(2, 3);
37+
extern PGDLLEXPORT void PLy_elog_impl(int elevel, const char *fmt,...) pg_attribute_printf(2, 3);
3838

39-
extern void PLy_exception_set(PyObject *exc, const char *fmt,...) pg_attribute_printf(2, 3);
39+
extern PGDLLEXPORT void PLy_exception_set(PyObject *exc, const char *fmt,...) pg_attribute_printf(2, 3);
4040

41-
extern void PLy_exception_set_plural(PyObject *exc, const char *fmt_singular, const char *fmt_plural,
42-
unsigned long n,...) pg_attribute_printf(2, 5) pg_attribute_printf(3, 5);
41+
extern PGDLLEXPORT void PLy_exception_set_plural(PyObject *exc, const char *fmt_singular, const char *fmt_plural,
42+
unsigned long n,...) pg_attribute_printf(2, 5) pg_attribute_printf(3, 5);
4343

44-
extern void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata);
44+
extern PGDLLEXPORT void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata);
4545

4646
#endif /* PLPY_ELOG_H */

src/pl/plpython/plpy_typeio.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -147,29 +147,29 @@ struct PLyObToDatum
147147
};
148148

149149

150-
extern PyObject *PLy_input_convert(PLyDatumToOb *arg, Datum val);
151-
extern Datum PLy_output_convert(PLyObToDatum *arg, PyObject *val,
152-
bool *isnull);
150+
extern PGDLLEXPORT PyObject *PLy_input_convert(PLyDatumToOb *arg, Datum val);
151+
extern PGDLLEXPORT Datum PLy_output_convert(PLyObToDatum *arg, PyObject *val,
152+
bool *isnull);
153153

154-
extern PyObject *PLy_input_from_tuple(PLyDatumToOb *arg, HeapTuple tuple,
155-
TupleDesc desc, bool include_generated);
154+
extern PGDLLEXPORT PyObject *PLy_input_from_tuple(PLyDatumToOb *arg, HeapTuple tuple,
155+
TupleDesc desc, bool include_generated);
156156

157-
extern void PLy_input_setup_func(PLyDatumToOb *arg, MemoryContext arg_mcxt,
158-
Oid typeOid, int32 typmod,
159-
struct PLyProcedure *proc);
160-
extern void PLy_output_setup_func(PLyObToDatum *arg, MemoryContext arg_mcxt,
161-
Oid typeOid, int32 typmod,
162-
struct PLyProcedure *proc);
157+
extern PGDLLEXPORT void PLy_input_setup_func(PLyDatumToOb *arg, MemoryContext arg_mcxt,
158+
Oid typeOid, int32 typmod,
159+
struct PLyProcedure *proc);
160+
extern PGDLLEXPORT void PLy_output_setup_func(PLyObToDatum *arg, MemoryContext arg_mcxt,
161+
Oid typeOid, int32 typmod,
162+
struct PLyProcedure *proc);
163163

164-
extern void PLy_input_setup_tuple(PLyDatumToOb *arg, TupleDesc desc,
165-
struct PLyProcedure *proc);
166-
extern void PLy_output_setup_tuple(PLyObToDatum *arg, TupleDesc desc,
167-
struct PLyProcedure *proc);
164+
extern PGDLLEXPORT void PLy_input_setup_tuple(PLyDatumToOb *arg, TupleDesc desc,
165+
struct PLyProcedure *proc);
166+
extern PGDLLEXPORT void PLy_output_setup_tuple(PLyObToDatum *arg, TupleDesc desc,
167+
struct PLyProcedure *proc);
168168

169-
extern void PLy_output_setup_record(PLyObToDatum *arg, TupleDesc desc,
170-
struct PLyProcedure *proc);
169+
extern PGDLLEXPORT void PLy_output_setup_record(PLyObToDatum *arg, TupleDesc desc,
170+
struct PLyProcedure *proc);
171171

172172
/* conversion from Python objects to C strings --- exported for transforms */
173-
extern char *PLyObject_AsString(PyObject *plrv);
173+
extern PGDLLEXPORT char *PLyObject_AsString(PyObject *plrv);
174174

175175
#endif /* PLPY_TYPEIO_H */

src/pl/plpython/plpy_util.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
#include "plpython.h"
1010

11-
extern PyObject *PLyUnicode_Bytes(PyObject *unicode);
12-
extern char *PLyUnicode_AsString(PyObject *unicode);
11+
extern PGDLLEXPORT PyObject *PLyUnicode_Bytes(PyObject *unicode);
12+
extern PGDLLEXPORT char *PLyUnicode_AsString(PyObject *unicode);
1313

14-
extern PyObject *PLyUnicode_FromString(const char *s);
15-
extern PyObject *PLyUnicode_FromStringAndSize(const char *s, Py_ssize_t size);
14+
extern PGDLLEXPORT PyObject *PLyUnicode_FromString(const char *s);
15+
extern PGDLLEXPORT PyObject *PLyUnicode_FromStringAndSize(const char *s, Py_ssize_t size);
1616

1717
#endif /* PLPY_UTIL_H */

src/test/modules/test_shm_mq/test_shm_mq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ extern void test_shm_mq_setup(int64 queue_size, int32 nworkers,
4040
shm_mq_handle **input);
4141

4242
/* Main entrypoint for a worker. */
43-
extern void test_shm_mq_main(Datum) pg_attribute_noreturn();
43+
extern PGDLLEXPORT void test_shm_mq_main(Datum) pg_attribute_noreturn();
4444

4545
#endif

src/test/modules/worker_spi/worker_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ PG_MODULE_MAGIC;
4646

4747
PG_FUNCTION_INFO_V1(worker_spi_launch);
4848

49-
void worker_spi_main(Datum) pg_attribute_noreturn();
49+
PGDLLEXPORT void worker_spi_main(Datum) pg_attribute_noreturn();
5050

5151
/* GUC variables */
5252
static int worker_spi_naptime = 10;

0 commit comments

Comments
 (0)