]> 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 10:41:56 +0000 (13:41 +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 b007f4ac6b5cab8080206f37e4dd35140ad37df1..2737e5863a4b856350aa3ebb71cc5efbc16c41c3 100644 (file)
@@ -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;