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.
(cherry picked from commit
830f04b5056db92ba96387db0a778dcd19a39522)
Co-authored-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
-#include <stdbool.h>
-
#include "Python.h"
#include "opcode.h"
#include "pycore_tuple.h" // _PyTuple_ITEMS()
#include "clinic/codeobject.c.h"
+#include <stdbool.h>
+
static const char *
code_event_name(PyCodeEvent event) {
switch (event) {
-#include <stdbool.h>
-
#include "Python.h"
#include "pycore_code.h" // write_location_entry_start()
#include "pycore_compile.h"
#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
* objects.
*/
-#include <stdbool.h>
-
#include "Python.h"
#include "opcode.h"
#include "pycore_ast.h" // _PyAST_GetDocString()
*/
#define STACK_USE_GUIDELINE 30
+#include <stdbool.h>
+
#undef SUCCESS
#undef ERROR
#define SUCCESS 0
/* TODO: Cull includes following phase split */
-#include <stdbool.h>
-
#include "Python.h"
#include "pycore_ast.h" // PyAST_mod2obj()
#include "errcode.h" // E_EOF
#include "marshal.h" // PyMarshal_ReadLongFromFile()
+#include <stdbool.h>
+
#ifdef MS_WINDOWS
# include "malloc.h" // alloca()
#endif