Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
postpone <stdbool.h> inclusion after Python.h#130641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
stdbool.h will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line
ghost commentedFeb 27, 2025 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
830f04b intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@chouquette for the PR, and@vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry,@chouquette and@vstinner, I could not cleanly backport this to |
GH-130675 is a backport of this pull request to the3.13 branch. |
Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.(cherry picked from commit830f04b)
Postpone <stdbool.h> inclusion after Python.h (#130641)Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.(cherry picked from commit830f04b)Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
colesbury commentedMar 1, 2025
I noticed we still have a bunch of places where we Lines 1 to 4 inddc27f9
cpython/Modules/_hashopenssl.c Lines 25 to 26 inddc27f9
cpython/Parser/string_parser.c Lines 1 to 3 inddc27f9
Lines 15 to 17 inddc27f9
Lines 1 to 3 inddc27f9
cpython/Python/instruction_sequence.c Lines 8 to 10 inddc27f9
|
chouquette commentedMar 1, 2025
Disclaimer: I don't know the python code base at all My take on this is that it seems |
vstinner commentedMar 3, 2025
Follow-up: PR#130738. |
Remove inclusions prior to Python.h.<stdbool.h> will cause <features.h> to be included before Python.h candefine some macros to enable some additional features, causing multipletypes not to be defined down the line.
stdbool.h will cause <features.h> to be included before Python.h can define some macros to enable some additional features, causing multiple types not to be defined down the line
In my specific case, this was causing build failures when building python with
zig cc