summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Include/exports.h12
-rw-r--r--Misc/NEWS.d/next/Build/2022-12-08-14-00-04.gh-issue-88267.MqtRbm.rst1
2 files changed, 10 insertions, 3 deletions
diff --git a/Include/exports.h b/Include/exports.h
index fc1a5c5..59373c3 100644
--- a/Include/exports.h
+++ b/Include/exports.h
@@ -2,9 +2,15 @@
#define Py_EXPORTS_H
#if defined(_WIN32) || defined(__CYGWIN__)
- #define Py_IMPORTED_SYMBOL __declspec(dllimport)
- #define Py_EXPORTED_SYMBOL __declspec(dllexport)
- #define Py_LOCAL_SYMBOL
+ #if defined(Py_ENABLE_SHARED)
+ #define Py_IMPORTED_SYMBOL __declspec(dllimport)
+ #define Py_EXPORTED_SYMBOL __declspec(dllexport)
+ #define Py_LOCAL_SYMBOL
+ #else
+ #define Py_IMPORTED_SYMBOL
+ #define Py_EXPORTED_SYMBOL
+ #define Py_LOCAL_SYMBOL
+ #endif
#else
/*
* If we only ever used gcc >= 5, we could use __has_attribute(visibility)
diff --git a/Misc/NEWS.d/next/Build/2022-12-08-14-00-04.gh-issue-88267.MqtRbm.rst b/Misc/NEWS.d/next/Build/2022-12-08-14-00-04.gh-issue-88267.MqtRbm.rst
new file mode 100644
index 0000000..29c3f5a
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2022-12-08-14-00-04.gh-issue-88267.MqtRbm.rst
@@ -0,0 +1 @@
+Avoid exporting Python symbols in linked Windows applications when the core is built as static.