summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>2025-02-28 09:09:27 (GMT)
committerGitHub <noreply@github.com>2025-02-28 09:09:27 (GMT)
commit830f04b5056db92ba96387db0a778dcd19a39522 (patch)
tree77dfda64670489e297dea00f51cd3537211e3675 /Python
parentfecf8bc8f2fd09a9a4c5177d32dbb42920b4e177 (diff)
downloadcpython-830f04b5056db92ba96387db0a778dcd19a39522.zip
cpython-830f04b5056db92ba96387db0a778dcd19a39522.tar.gz
cpython-830f04b5056db92ba96387db0a778dcd19a39522.tar.bz2
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 can define some macros to enable some additional features, causing multiple types not to be defined down the line.
Diffstat (limited to 'Python')
-rw-r--r--Python/assemble.c3
-rw-r--r--Python/compile.c4
-rw-r--r--Python/pythonrun.c4
3 files changed, 5 insertions, 6 deletions
diff --git a/Python/assemble.c b/Python/assemble.c
index f7b88b5..6dcac33 100644
--- a/Python/assemble.c
+++ b/Python/assemble.c
@@ -1,5 +1,3 @@
-#include <stdbool.h>
-
#include "Python.h"
#include "pycore_code.h" // write_location_entry_start()
#include "pycore_compile.h"
@@ -8,6 +6,7 @@
#include "pycore_opcode_metadata.h" // is_pseudo_target, _PyOpcode_Caches
#include "pycore_symtable.h" // _Py_SourceLocation
+#include <stdbool.h>
#define DEFAULT_CODE_SIZE 128
#define DEFAULT_LNOTAB_SIZE 16
diff --git a/Python/compile.c b/Python/compile.c
index b58c12d..cd68b89 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -14,8 +14,6 @@
*
*/
-#include <stdbool.h>
-
#include "Python.h"
#include "pycore_ast.h" // PyAST_Check, _PyAST_GetDocString()
#include "pycore_compile.h"
@@ -25,6 +23,8 @@
#include "cpython/code.h"
+#include <stdbool.h>
+
#undef SUCCESS
#undef ERROR
#define SUCCESS 0
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 9b882d9..75d91b2 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -8,8 +8,6 @@
/* TODO: Cull includes following phase split */
-#include <stdbool.h>
-
#include "Python.h"
#include "pycore_ast.h" // PyAST_mod2obj()
@@ -29,6 +27,8 @@
#include "errcode.h" // E_EOF
#include "marshal.h" // PyMarshal_ReadLongFromFile()
+#include <stdbool.h>
+
#ifdef MS_WINDOWS
# include "malloc.h" // alloca()
#endif