> If I understand correctly, I've found the root cause of the issue. > I've sent a pull request to numpy. > https://github.com/numpy/numpy/pull/20874
A question is asked by NumPy if there is documentation on the Cygwin package's Cython behavior. https://github.com/numpy/numpy/pull/20874#issuecomment-1019442058 Does such a document exist? One of the causes of this issue is a patch in Cygwin's python-cython package like the one below. It removes the `__declspec(dllexport)` attribute from the symbols to be exported. On the other hand, if you install Cython by pip without using the Cygwin package, the exported symbols have the `__declspec(dllexport)` attribute because the patch has not been applied. What is the purpose of removing the `__declspec(dllexport)` attribute in this patch? Is this to make the modules using Cython without considering the Cygwin environment, the module does not have the `__declspec(dllexport)` attribute like Linux environment, works correctly? ``` --- origsrc/Cython-0.29.21/Cython/Utility/ModuleSetupCode.c 2020-07-08 23:44:39.000000000 +0200 +++ Cython/Utility/ModuleSetupCode.c 2021-01-30 08:34:37.402649500 +0100 @@ -709,7 +709,11 @@ static CYTHON_INLINE void * PyThread_tss /////////////// PyModInitFuncType.proto /////////////// #ifndef CYTHON_NO_PYINIT_EXPORT -#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC +#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. ``` -- 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