From: Peter Eisentraut Date: Thu, 18 Aug 2011 09:53:32 +0000 (+0300) Subject: Change PyInit_plpy to external linkage X-Git-Tag: REL9_0_5~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4c24254fab0b9908211f990c4239664f3ed5630;p=thirdparty%2Fpostgresql.git Change PyInit_plpy to external linkage Module initialization functions in Python 3 must have external linkage, because PyMODINIT_FUNC does dllexport on Windows-like platforms. Without this change, the build with Python 3 fails on Windows. --- diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 54af7f2a67c..19037d1fb9a 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -3205,7 +3205,13 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status) */ #if PY_MAJOR_VERSION >= 3 -static PyMODINIT_FUNC +/* + * Must have external linkage, because PyMODINIT_FUNC does dllexport on + * Windows-like platforms. + */ +PyMODINIT_FUNC PyInit_plpy(void); + +PyMODINIT_FUNC PyInit_plpy(void) { return PyModule_Create(&PLy_module);