◐ Shell
clean mode source ↗

gh-85283: If Py_LIMITED_API is defined, undefine Py_BUILD_CORE by vstinner · Pull Request #110725 · python/cpython

If the Py_LIMITED_API macro is defined, Py_BUILD_CORE,
Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros are now
undefined by Python.h.

Only undefine these 3 macros after including "exports.h" which uses
them to define PyAPI_FUNC(), PyAPI_DATA() and PyMODINIT_FUNC macros.

@vstinner

@vstinner vstinner deleted the limited_api_build_core branch

October 11, 2023 20:47

Glyphack pushed a commit to Glyphack/cpython that referenced this pull request

Sep 2, 2024
…ython#110725)

If the Py_LIMITED_API macro is defined, Py_BUILD_CORE,
Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE macros are now
undefined by Python.h.

Only undefine these 3 macros after including "exports.h" which uses
them to define PyAPI_FUNC(), PyAPI_DATA() and PyMODINIT_FUNC macros.

Remove hacks (undefine manually the 3 Py_BUILD_CORE macros) in
Modules/_testcapi/parts.h and Modules/_testclinic_limited.c.