Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Ensure that ``Python.h`` is included before ``stdbool.h`` unless ``pyconfig.h``
is included before or in some platform-specific contexts.
3 changes: 2 additions & 1 deletion Modules/_blake2/blake2b_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#include <stdbool.h>
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex()

#include <stdbool.h>

#include "../hashlib.h"
#include "blake2module.h"

Expand Down
3 changes: 2 additions & 1 deletion Modules/_blake2/blake2s_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#include <stdbool.h>
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex()

#include <stdbool.h>

#include "../hashlib.h"
#include "blake2module.h"

Expand Down
2 changes: 1 addition & 1 deletion Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# define Py_BUILD_CORE_MODULE 1
#endif

#include <stdbool.h>
#include "Python.h"
#include "pycore_hashtable.h"
#include "pycore_pyhash.h" // _Py_HashBytes()
Expand All @@ -38,6 +37,7 @@
#include <openssl/objects.h>
#include <openssl/err.h>

#include <stdbool.h>

#ifndef OPENSSL_THREADS
# error "OPENSSL_THREADS is not defined, Python requires thread-safe OpenSSL"
Expand Down
4 changes: 2 additions & 2 deletions Parser/string_parser.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <stdbool.h>

#include <Python.h>
#include "pycore_bytesobject.h" // _PyBytes_DecodeEscape()
#include "pycore_unicodeobject.h" // _PyUnicode_DecodeUnicodeEscapeInternal()
Expand All @@ -8,6 +6,8 @@
#include "pegen.h"
#include "string_parser.h"

#include <stdbool.h>

//// STRING HANDLING FUNCTIONS ////

static int
Expand Down
5 changes: 2 additions & 3 deletions Python/flowgraph.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

#include <stdbool.h>

#include "Python.h"
#include "pycore_flowgraph.h"
#include "pycore_compile.h"
Expand All @@ -9,6 +6,8 @@
#include "pycore_opcode_utils.h"
#include "pycore_opcode_metadata.h" // OPCODE_HAS_ARG, etc

#include <stdbool.h>


#undef SUCCESS
#undef ERROR
Expand Down
4 changes: 2 additions & 2 deletions Python/instruction_sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/


#include <stdbool.h>

#include "Python.h"

#include "pycore_compile.h" // _PyCompile_EnsureArrayLargeEnough
Expand All @@ -22,6 +20,8 @@ typedef _Py_SourceLocation location;

#include "clinic/instruction_sequence.c.h"

#include <stdbool.h>

#undef SUCCESS
#undef ERROR
#define SUCCESS 0
Expand Down
Loading