Commit c9dec706 authored by Stefan Behnel's avatar Stefan Behnel

Make sure the module init function is declared as 'extern "C"' in C++ also...

Make sure the module init function is declared as 'extern "C"' in C++ also when the CYTHON_NO_PYINIT_EXPORT option is used.
Closes #3414.
parent a21937ab
......@@ -32,6 +32,10 @@ Bugs fixed
additional command line arguments leaked into the regular command.
Patch by Kamekameha. (Github issue #2209)
* When using the ``CYTHON_NO_PYINIT_EXPORT`` option in C++, the module init function
was not declared as ``extern "C"``.
(Github issue #3414)
0.29.17 (2020-04-26)
====================
......
......@@ -695,24 +695,24 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
/////////////// PyModInitFuncType.proto ///////////////
#if PY_MAJOR_VERSION < 3
#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#ifdef CYTHON_NO_PYINIT_EXPORT
// define this to void manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#define __Pyx_PyMODINIT_FUNC void
#elif PY_MAJOR_VERSION < 3
// Py2: define this to void manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
// define this to PyObject * manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#define __Pyx_PyMODINIT_FUNC PyObject *
// Py3+: define this to PyObject * manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif
......@@ -858,7 +858,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
/////////////// MathInitCode ///////////////
#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#define _USE_MATH_DEFINESg
#endif
#include <math.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment