[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. |
| 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.
Why do you add <stdbool.h> include?
There was a problem hiding this comment.
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 |
EDIT: regen-all was sufficient, my bad! |
stdbool.his included afterPython.h#130740