Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2011-08-18 09:53:32 +0000
committerPeter Eisentraut2011-08-18 09:59:43 +0000
commite1f9aa4eaecd8107230df1a1b698e8caf0fba4f8 (patch)
treef1a04ca1d0ef7ceadd18c06898b09d5ecf4e824a /src/pl/plpython/plpython.c
parentf684bcb5238c13c8ba5a3770f4d0856677f99b35 (diff)
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.
Diffstat (limited to 'src/pl/plpython/plpython.c')
-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 b981dec7c2e..17c583ec357 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -4066,7 +4066,13 @@ PLy_add_exceptions(PyObject *plpy)
}
#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)
{
PyObject *m;