Skip to content

Commit d4c2425

Browse files
committed
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.
1 parent 1853e12 commit d4c2425

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/pl/plpython/plpython.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3205,7 +3205,13 @@ PLy_spi_execute_fetch_result(SPITupleTable *tuptable, int rows, int status)
32053205
*/
32063206

32073207
#if PY_MAJOR_VERSION >= 3
3208-
static PyMODINIT_FUNC
3208+
/*
3209+
* Must have external linkage, because PyMODINIT_FUNC does dllexport on
3210+
* Windows-like platforms.
3211+
*/
3212+
PyMODINIT_FUNC PyInit_plpy(void);
3213+
3214+
PyMODINIT_FUNC
32093215
PyInit_plpy(void)
32103216
{
32113217
return PyModule_Create(&PLy_module);

0 commit comments

Comments
 (0)