[3.12] gh-130740: Move some stdbool.h includes after Python.h (#130738) (#130757)

gh-130740: Move some `stdbool.h` includes after `Python.h` (#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` (this caused some
build failures when compiling CPython with `zig cc`).

(cherry-picked from commit 214562ed4d)

---------

Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
This commit is contained in:
Bénédikt Tran 2025-03-04 10:38:24 +01:00 committed by GitHub
parent 519dec97e7
commit 7ce5f15981
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 18 additions and 13 deletions

View file

@ -8,8 +8,6 @@
/* TODO: Cull includes following phase split */
#include <stdbool.h>
#include "Python.h"
#include "pycore_ast.h" // PyAST_mod2obj
@ -27,6 +25,8 @@
#include "errcode.h" // E_EOF
#include "marshal.h" // PyMarshal_ReadLongFromFile()
#include <stdbool.h>
#ifdef MS_WINDOWS
# include "malloc.h" // alloca()
#endif