From: Peter Eisentraut Date: Thu, 18 Aug 2011 09:53:32 +0000 (+0300) Subject: Change PyInit_plpy to external linkage X-Git-Tag: REL9_2_BETA1~1271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e1f9aa4eaecd8107230df1a1b698e8caf0fba4f8;p=postgresql 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. --- diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index b981dec7c2..17c583ec35 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;