aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2011-08-18 12:53:32 +0300
committerPeter Eisentraut <peter_e@gmx.net>2011-08-18 13:41:56 +0300
commit7b1509d56256fa391d4ae71288be194923a41947 (patch)
tree5349c4a28d35af708fdd6c8a9cd7d2e2f4323304
parentf85e4057cfe62752eb57d2315d4acda5bb5c1e9e (diff)
downloadpostgresql-7b1509d56256fa391d4ae71288be194923a41947.tar.gz
postgresql-7b1509d56256fa391d4ae71288be194923a41947.zip
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.
-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 b007f4ac6b5..2737e5863a4 100644
--- a/src/pl/plpython/plpython.c
+++ b/src/pl/plpython/plpython.c
@@ -4026,7 +4026,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;