]> granicus.if.org Git - postgresql/commitdiff
Change PyInit_plpy to external linkage
authorPeter Eisentraut <peter_e@gmx.net>
Thu, 18 Aug 2011 09:53:32 +0000 (12:53 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Thu, 18 Aug 2011 09:59:43 +0000 (12:59 +0300)
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

index b981dec7c2ec8b89b90be2ddbaf5ed1ad2410782..17c583ec357161012512ece629ae56760c7992ba 100644 (file)
@@ -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;