From d4c24254fab0b9908211f990c4239664f3ed5630 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 18 Aug 2011 12:53:32 +0300 Subject: [PATCH] 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. --- src/pl/plpython/plpython.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.5