Add feature macro PY_HAVE_THREAD_NATIVE_ID to the stable ABI definiti… · python/cpython@1c2fddd

Original file line numberDiff line numberDiff line change

@@ -49,8 +49,17 @@

4949

'MS_WINDOWS': 'on Windows',

5050

'HAVE_FORK': 'on platforms with fork()',

5151

'USE_STACKCHECK': 'on platforms with USE_STACKCHECK',

52+

'PY_HAVE_THREAD_NATIVE_ID': 'on platforms with native thread IDs',

5253

}

5354
55+

# To generate the DLL definition, we need to know which feature macros are

56+

# defined on Windows. On all platforms.

57+

# Best way to do that is to hardcode the list (and later test in on Windows).

58+

WINDOWS_IFDEFS = frozenset({

59+

'MS_WINDOWS',

60+

'PY_HAVE_THREAD_NATIVE_ID',

61+

})

62+
5463

# The stable ABI manifest (Misc/stable_abi.txt) exists only to fill the

5564

# following dataclasses.

5665

# Feel free to change its syntax (and the `parse_manifest` function)

@@ -232,15 +241,15 @@ def sort_key(item):

232241
233242

for item in sorted(

234243

manifest.select(

235-

{'function'}, include_abi_only=True, ifdef={'MS_WINDOWS'}),

244+

{'function'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS),

236245

key=sort_key):

237246

write(f'EXPORT_FUNC({item.name})')

238247
239248

write()

240249
241250

for item in sorted(

242251

manifest.select(

243-

{'data'}, include_abi_only=True, ifdef={'MS_WINDOWS'}),

252+

{'data'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS),

244253

key=sort_key):

245254

write(f'EXPORT_DATA({item.name})')

246255