-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
[3.12] gh-130740: Move some stdbool.h
includes after Python.h
(#130738)
#130757
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.12] gh-130740: Move some stdbool.h
includes after Python.h
(#130738)
#130757
Conversation
…hon#130738) Move some `#include <stdbool.h>` after `#include "Python.h"` when `pyconfig.h` is not included first and when we are in a platform-agnostic context. This is to avoid having features defined by `stdbool.h` before those decided by `Python.h`.
For this one, I'd like approval from @markshannon as I modified the generator cases. |
@@ -986,6 +986,9 @@ def write_metadata(self) -> None: | |||
self.out.write_raw(self.from_source_files()) | |||
self.out.write_raw(f"// Do not edit!\n") | |||
|
|||
self.out.write_raw("\n") | |||
self.out.write_raw("#include <stdbool.h>") |
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.
Why do you add <stdbool.h> include?
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.
Because there are some bool
inside the generate_metadata.h
file which, without this include, doesn't compile. Previously, it was because we included stdbool.h before including this file so it was impliticitly available (see https://github.com/python/cpython/actions/runs/13614386994/job/38055588576?pr=130757)
The change to |
Don't the generated files need to be regenerated? |
I should have regenerated them? efd75da#diff-f862bc60824529a25ba378be850ecc6762f03c6c944266d30ac7172d10132498. Or are there more rules that I needed to run? |
I downloaded the PR and ran |
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
EDIT: regen-all was sufficient, my bad! |
stdbool.h
is included afterPython.h
#130740