Skip to content

Commit c0e0a83

Browse files
committed
Use __declspec(dllexport) outside core
1 parent fd34aff commit c0e0a83

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Include/exports.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
#if defined(_WIN32) || defined(__CYGWIN__)
30-
#define _PyINIT_EXPORTED_SYMBOL __declspec(dllexport)
3130
#if defined(Py_ENABLE_SHARED)
3231
#define Py_IMPORTED_SYMBOL __declspec(dllimport)
3332
#define Py_EXPORTED_SYMBOL __declspec(dllexport)
@@ -37,6 +36,12 @@
3736
#define Py_EXPORTED_SYMBOL
3837
#define Py_LOCAL_SYMBOL
3938
#endif
39+
/* module init functions outside the core must be exported */
40+
#if defined(Py_BUILD_CORE)
41+
#define _PyINIT_EXPORTED_SYMBOL Py_EXPORTED_SYMBOL
42+
#else
43+
#define _PyINIT_EXPORTED_SYMBOL __declspec(dllexport)
44+
#endif
4045
#else
4146
/*
4247
* If we only ever used gcc >= 5, we could use __has_attribute(visibility)
@@ -80,13 +85,6 @@
8085
# define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE
8186
# endif /* !__CYGWIN__ */
8287
# define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
83-
/* module init functions outside the core must be exported */
84-
# if defined(__cplusplus)
85-
# define _PyINIT_FUNC_DECLSPEC extern "C" \
86-
_PyINIT_EXPORTED_SYMBOL
87-
# else /* __cplusplus */
88-
# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL
89-
# endif /* __cplusplus */
9088
# endif /* Py_BUILD_CORE */
9189
# endif /* HAVE_DECLSPEC_DLL */
9290
#endif /* Py_ENABLE_SHARED */

0 commit comments

Comments
 (0)