On 29.01.2021 15:18, Marco Atzeri wrote:
On 29.01.2021 11:31, Masamichi Hosoda wrote:
Hi,

I've found that modules built by python-cython with C++ could not be loaded.
If I understand correctly, the following patch fixes it.
Would you like to apply this patch to the package?

```
--- a/Cython-0.29.21/Cython/Utility/ModuleSetupCode.c
+++ b/Cython-0.29.21/Cython/Utility/ModuleSetupCode.c
@@ -709,7 +709,11 @@
  /////////////// PyModInitFuncType.proto ///////////////
  #ifndef CYTHON_NO_PYINIT_EXPORT
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC  extern "C" PyObject *
+#else
  #define __Pyx_PyMODINIT_FUNC  PyObject *
+#endif
  #elif PY_MAJOR_VERSION < 3
  // Py2: define this to void manually because PyMODINIT_FUNC adds __declspec(dllexport) to it's definition.
```


have you considered that you just need to define
CYTHON_NO_PYINIT_EXPORT ?

the portion of the code below your change has already the
ifdef __cplusplus semantic

Have you proposed it upstream ? It does not seem
a change restricted to Cygwin

Any way I see no "wrongness" to add it on the Cython rebuild

Regards
Marco

--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to