summaryrefslogtreecommitdiffstats
path: root/Include/exports.h
diff options
context:
space:
mode:
authorChristian Rendina <christian.rendina@gmail.com>2022-12-09 11:16:15 (GMT)
committerGitHub <noreply@github.com>2022-12-09 11:16:15 (GMT)
commit3c5355496b54fa0a4ea0e22344d008528e45682c (patch)
tree114e6dcc459feba750e0ba6e6ede338c0f1adf1f /Include/exports.h
parent748c6c0921ee02a19e01a35f03ce5f4d9cfde5a6 (diff)
downloadcpython-3c5355496b54fa0a4ea0e22344d008528e45682c.zip
cpython-3c5355496b54fa0a4ea0e22344d008528e45682c.tar.gz
cpython-3c5355496b54fa0a4ea0e22344d008528e45682c.tar.bz2
gh-88267: Avoid DLL exporting functions from static builds on Windows(GH-99888)
Diffstat (limited to 'Include/exports.h')
-rw-r--r--Include/exports.h12
1 files changed, 9 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)