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 ...@@ -32,6 +32,10 @@ Bugs fixed
additional command line arguments leaked into the regular command. additional command line arguments leaked into the regular command.
Patch by Kamekameha. (Github issue #2209) 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) 0.29.17 (2020-04-26)
==================== ====================
......
...@@ -695,24 +695,24 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { ...@@ -695,24 +695,24 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
/////////////// PyModInitFuncType.proto /////////////// /////////////// PyModInitFuncType.proto ///////////////
#if PY_MAJOR_VERSION < 3 #ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#ifdef CYTHON_NO_PYINIT_EXPORT #elif PY_MAJOR_VERSION < 3
// define this to void manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition. // Py2: define this to void manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#define __Pyx_PyMODINIT_FUNC void #ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else #else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #define __Pyx_PyMODINIT_FUNC void
#endif #endif
#else #else
// Py3+: define this to PyObject * manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
#ifdef CYTHON_NO_PYINIT_EXPORT #ifdef __cplusplus
// define this to PyObject * manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition. #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#define __Pyx_PyMODINIT_FUNC PyObject *
#else #else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #define __Pyx_PyMODINIT_FUNC PyObject *
#endif #endif
#endif #endif
...@@ -858,7 +858,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj ...@@ -858,7 +858,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
/////////////// MathInitCode /////////////// /////////////// MathInitCode ///////////////
#if defined(WIN32) || defined(MS_WINDOWS) #if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES #define _USE_MATH_DEFINESg
#endif #endif
#include <math.h> #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