|
25 | 25 | # define HAVE_DECLSPEC_DLL |
26 | 26 | #endif |
27 | 27 |
|
| 28 | + |
28 | 29 | #if defined(_WIN32) || defined(__CYGWIN__) |
29 | | - #if !defined(Py_BUILD_CORE) || defined(Py_ENABLE_SHARED) |
| 30 | + #define _PyINIT_EXPORTED_SYMBOL __declspec(dllexport) |
| 31 | + #if defined(Py_ENABLE_SHARED) |
30 | 32 | #define Py_IMPORTED_SYMBOL __declspec(dllimport) |
31 | 33 | #define Py_EXPORTED_SYMBOL __declspec(dllexport) |
32 | 34 | #define Py_LOCAL_SYMBOL |
|
52 | 54 | #define Py_EXPORTED_SYMBOL |
53 | 55 | #define Py_LOCAL_SYMBOL |
54 | 56 | #endif |
| 57 | + #define _PyINIT_EXPORTED_SYMBOL Py_EXPORTED_SYMBOL |
55 | 58 | #endif |
56 | 59 |
|
57 | 60 | /* only get special linkage if built as shared or platform is Cygwin */ |
|
63 | 66 | /* module init functions inside the core need no external linkage */ |
64 | 67 | /* except for Cygwin to handle embedding */ |
65 | 68 | # if defined(__CYGWIN__) |
66 | | -# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL |
| 69 | +# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL |
67 | 70 | # else /* __CYGWIN__ */ |
68 | 71 | # define _PyINIT_FUNC_DECLSPEC |
69 | 72 | # endif /* __CYGWIN__ */ |
|
79 | 82 | # define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE |
80 | 83 | /* module init functions outside the core must be exported */ |
81 | 84 | # if defined(__cplusplus) |
82 | | -# define _PyINIT_FUNC_DECLSPEC extern "C" Py_EXPORTED_SYMBOL |
| 85 | +# define _PyINIT_FUNC_DECLSPEC extern "C" \ |
| 86 | + _PyINIT_EXPORTED_SYMBOL |
83 | 87 | # else /* __cplusplus */ |
84 | | -# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL |
| 88 | +# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL |
85 | 89 | # endif /* __cplusplus */ |
86 | 90 | # endif /* Py_BUILD_CORE */ |
87 | 91 | # endif /* HAVE_DECLSPEC_DLL */ |
|
96 | 100 | #endif |
97 | 101 | #ifndef _PyINIT_FUNC_DECLSPEC |
98 | 102 | # if defined(__cplusplus) |
99 | | -# define _PyINIT_FUNC_DECLSPEC extern "C" Py_EXPORTED_SYMBOL |
| 103 | +# define _PyINIT_FUNC_DECLSPEC extern "C" _PyINIT_EXPORTED_SYMBOL |
100 | 104 | # else /* __cplusplus */ |
101 | | -# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL |
| 105 | +# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL |
102 | 106 | # endif /* __cplusplus */ |
103 | 107 | #endif |
104 | 108 |
|
|
0 commit comments