summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2011-08-18 09:53:32 +0000
committerPeter Eisentraut2011-08-18 10:47:35 +0000
commitd4c24254fab0b9908211f990c4239664f3ed5630 (patch)
treee7ff4e681b0f0e3f295395d4e9f949f7123907f6
parent1853e120f7badea0cd9b62ff2ad2a0dc60a5f1fe (diff)
Change PyInit_plpy to external linkageREL9_0_STABLE
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.
-rw-r--r--src/pl/plpython/plpython.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c
index 54af7f2a67..19037d1fb9 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);