Skip to content

Commit fd34aff

Browse files
committed
Use _PyINIT_EXPORTED_SYMBOL
1 parent ad9110c commit fd34aff

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Include/exports.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525
# define HAVE_DECLSPEC_DLL
2626
#endif
2727

28+
2829
#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)
3032
#define Py_IMPORTED_SYMBOL __declspec(dllimport)
3133
#define Py_EXPORTED_SYMBOL __declspec(dllexport)
3234
#define Py_LOCAL_SYMBOL
@@ -52,6 +54,7 @@
5254
#define Py_EXPORTED_SYMBOL
5355
#define Py_LOCAL_SYMBOL
5456
#endif
57+
#define _PyINIT_EXPORTED_SYMBOL Py_EXPORTED_SYMBOL
5558
#endif
5659

5760
/* only get special linkage if built as shared or platform is Cygwin */
@@ -63,7 +66,7 @@
6366
/* module init functions inside the core need no external linkage */
6467
/* except for Cygwin to handle embedding */
6568
# if defined(__CYGWIN__)
66-
# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL
69+
# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL
6770
# else /* __CYGWIN__ */
6871
# define _PyINIT_FUNC_DECLSPEC
6972
# endif /* __CYGWIN__ */
@@ -79,9 +82,10 @@
7982
# define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
8083
/* module init functions outside the core must be exported */
8184
# if defined(__cplusplus)
82-
# define _PyINIT_FUNC_DECLSPEC extern "C" Py_EXPORTED_SYMBOL
85+
# define _PyINIT_FUNC_DECLSPEC extern "C" \
86+
_PyINIT_EXPORTED_SYMBOL
8387
# else /* __cplusplus */
84-
# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL
88+
# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL
8589
# endif /* __cplusplus */
8690
# endif /* Py_BUILD_CORE */
8791
# endif /* HAVE_DECLSPEC_DLL */
@@ -96,9 +100,9 @@
96100
#endif
97101
#ifndef _PyINIT_FUNC_DECLSPEC
98102
# if defined(__cplusplus)
99-
# define _PyINIT_FUNC_DECLSPEC extern "C" Py_EXPORTED_SYMBOL
103+
# define _PyINIT_FUNC_DECLSPEC extern "C" _PyINIT_EXPORTED_SYMBOL
100104
# else /* __cplusplus */
101-
# define _PyINIT_FUNC_DECLSPEC Py_EXPORTED_SYMBOL
105+
# define _PyINIT_FUNC_DECLSPEC _PyINIT_EXPORTED_SYMBOL
102106
# endif /* __cplusplus */
103107
#endif
104108

0 commit comments

Comments
 (0)