]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Postpone <stdbool.h> inclusion after Python.h (#130641)
authorHugo Beauzée-Luyssen <hugo@beauzee.fr>
Fri, 28 Feb 2025 09:09:27 +0000 (10:09 +0100)
committerGitHub <noreply@github.com>
Fri, 28 Feb 2025 09:09:27 +0000 (10:09 +0100)
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.

Objects/codeobject.c
Python/assemble.c
Python/compile.c
Python/pythonrun.c

index a7b46aa2dfbbc0a9f2601f2fca3d7b5918eb9d05..833c4d10ba831802405e91731275c80c8070322b 100644 (file)
@@ -1,5 +1,3 @@
-#include <stdbool.h>
-
 #include "Python.h"
 #include "opcode.h"
 
@@ -20,6 +18,8 @@
 #include "pycore_uniqueid.h"      // _PyObject_AssignUniqueId()
 #include "clinic/codeobject.c.h"
 
+#include <stdbool.h>
+
 #define INITIAL_SPECIALIZED_CODE_SIZE 16
 
 static const char *
index f7b88b519f5f7131a568669cccdca3b71a24f4ee..6dcac332f076d859a96a3955991cbcfbdb6ab9b8 100644 (file)
@@ -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
index b58c12d4b881ac5015133ae3a263716252c206fd..cd68b897cf6188a420ee817b07f0f2939fd50a69 100644 (file)
@@ -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
index 9b882d982a9e5038308d2abcec2ccfe724c0e2bc..75d91b2040cdd5dd47cbe249486a8da85d438dbe 100644 (file)
@@ -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