diff options
author | Petr Viktorin <encukou@gmail.com> | 2022-04-08 12:35:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-08 12:35:11 (GMT) |
commit | 1c2fddddae5ce27be354b519f8ae51886b4dd9f4 (patch) | |
tree | dea0d25edc0c2a4515f14411368718351866731d /Tools/scripts | |
parent | 5b4a4b6f0905c60514528b454af43aeea058b5a2 (diff) | |
download | cpython-1c2fddddae5ce27be354b519f8ae51886b4dd9f4.zip cpython-1c2fddddae5ce27be354b519f8ae51886b4dd9f4.tar.gz cpython-1c2fddddae5ce27be354b519f8ae51886b4dd9f4.tar.bz2 |
Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition (GH-32365)
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/stable_abi.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py index feca9a2..9b90e34 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -49,8 +49,17 @@ IFDEF_DOC_NOTES = { 'MS_WINDOWS': 'on Windows', 'HAVE_FORK': 'on platforms with fork()', 'USE_STACKCHECK': 'on platforms with USE_STACKCHECK', + 'PY_HAVE_THREAD_NATIVE_ID': 'on platforms with native thread IDs', } +# To generate the DLL definition, we need to know which feature macros are +# defined on Windows. On all platforms. +# Best way to do that is to hardcode the list (and later test in on Windows). +WINDOWS_IFDEFS = frozenset({ + 'MS_WINDOWS', + 'PY_HAVE_THREAD_NATIVE_ID', +}) + # The stable ABI manifest (Misc/stable_abi.txt) exists only to fill the # following dataclasses. # Feel free to change its syntax (and the `parse_manifest` function) @@ -232,7 +241,7 @@ def gen_python3dll(manifest, args, outfile): for item in sorted( manifest.select( - {'function'}, include_abi_only=True, ifdef={'MS_WINDOWS'}), + {'function'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS), key=sort_key): write(f'EXPORT_FUNC({item.name})') @@ -240,7 +249,7 @@ def gen_python3dll(manifest, args, outfile): for item in sorted( manifest.select( - {'data'}, include_abi_only=True, ifdef={'MS_WINDOWS'}), + {'data'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS), key=sort_key): write(f'EXPORT_DATA({item.name})') |