Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definition (GH-32365)

This commit is contained in:
Petr Viktorin 2022-04-08 14:35:11 +02:00 committed by GitHub
parent 5b4a4b6f09
commit 1c2fddddae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 4 deletions

View file

@ -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})')