Skip to content

Commit 0343bc9

Browse files
committed
List manually static inline functions in stable_abi.py
1 parent fcf7b5c commit 0343bc9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎Tools/build/stable_abi.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,17 @@
4949
UNIXY = MACOS or (sys.platform == "linux") # XXX should this be "not Windows"?
5050

5151

52+
# "Macros" implemented as static inline functions, documented as macros
53+
# by Misc/stable_abi.toml, and not listed by gcc_get_limited_api_macros()
54+
STATIC_INLINE_FUNCTIONS = set((
55+
'Py_INCREF',
56+
'Py_SET_REFCNT',
57+
'Py_SET_TYPE',
58+
'Py_XDECREF',
59+
'Py_XINCREF',
60+
))
61+
62+
5263
# The stable ABI manifest (Misc/stable_abi.toml) exists only to fill the
5364
# following dataclasses.
5465
# Feel free to change its syntax (and the `parse_manifest` function)
@@ -404,6 +415,7 @@ def do_unixy_check(manifest, args):
404415
# Get all macros first: we'll need feature macros like HAVE_FORK and
405416
# MS_WINDOWS for everything else
406417
present_macros = gcc_get_limited_api_macros(['Include/Python.h'])
418+
present_macros |= STATIC_INLINE_FUNCTIONS
407419
feature_macros = {m.name for m in manifest.select({'feature_macro'})}
408420
feature_macros &= present_macros
409421

0 commit comments

Comments
 (0)