@@ -49,8 +49,17 @@
|
49 | 49 | 'MS_WINDOWS': 'on Windows', |
50 | 50 | 'HAVE_FORK': 'on platforms with fork()', |
51 | 51 | 'USE_STACKCHECK': 'on platforms with USE_STACKCHECK', |
| 52 | +'PY_HAVE_THREAD_NATIVE_ID': 'on platforms with native thread IDs', |
52 | 53 | } |
53 | 54 | |
| 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 | + |
54 | 63 | # The stable ABI manifest (Misc/stable_abi.txt) exists only to fill the |
55 | 64 | # following dataclasses. |
56 | 65 | # Feel free to change its syntax (and the `parse_manifest` function) |
@@ -232,15 +241,15 @@ def sort_key(item):
|
232 | 241 | |
233 | 242 | for item in sorted( |
234 | 243 | manifest.select( |
235 | | - {'function'}, include_abi_only=True, ifdef={'MS_WINDOWS'}), |
| 244 | + {'function'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS), |
236 | 245 | key=sort_key): |
237 | 246 | write(f'EXPORT_FUNC({item.name})') |
238 | 247 | |
239 | 248 | write() |
240 | 249 | |
241 | 250 | for item in sorted( |
242 | 251 | manifest.select( |
243 | | - {'data'}, include_abi_only=True, ifdef={'MS_WINDOWS'}), |
| 252 | + {'data'}, include_abi_only=True, ifdef=WINDOWS_IFDEFS), |
244 | 253 | key=sort_key): |
245 | 254 | write(f'EXPORT_DATA({item.name})') |
246 | 255 | |
|