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

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 11, 2023

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.


📚 Documentation preview 📚: https://cpython-previews--110725.org.readthedocs.build/

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 force-pushed the limited_api_build_core branch from 097c71b to 105fce1 Compare October 11, 2023 15:38
@vstinner vstinner merged commit 6f4a499 into python:main Oct 11, 2023
@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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant