postgres.git / summary / log / commit / refs
commit e1f9aa4eaecd8107230df1a1b698e8caf0fba4f8
Author: Peter Eisentraut <peter_e@gmx.net>
Date: Thu Aug 18 09:53:32 2011 +0000
First released in: 9.2.0, 9.0.5, 9.1.0
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 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;
[parent: f684bcb5238c]