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

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-03 13:09:59 +01:00 committed by GitHub
parent 9643ce9019
commit 00cf2a621a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 10 deletions

View file

@ -1,5 +1,3 @@
#include <stdbool.h>
#include <Python.h>
#include "pycore_bytesobject.h" // _PyBytes_DecodeEscape()
#include "pycore_unicodeobject.h" // _PyUnicode_DecodeUnicodeEscapeInternal()
@ -8,6 +6,8 @@
#include "pegen.h"
#include "string_parser.h"
#include <stdbool.h>
//// STRING HANDLING FUNCTIONS ////
static int