diff options
author | Petr Viktorin <encukou@gmail.com> | 2022-02-25 08:25:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-25 08:25:54 (GMT) |
commit | 2c228a7b8f89e9ed8d390370abd771d4993b79d8 (patch) | |
tree | 6c3316eb466ed4feb1221d4ece109695f01e77aa /Modules | |
parent | 98c3bea4d1c7335135e60946d0ec8cd5031fb6c0 (diff) | |
download | cpython-2c228a7b8f89e9ed8d390370abd771d4993b79d8.zip cpython-2c228a7b8f89e9ed8d390370abd771d4993b79d8.tar.gz cpython-2c228a7b8f89e9ed8d390370abd771d4993b79d8.tar.bz2 |
bpo-46748: Don't import <stdbool.h> in public headers (GH-31553)
<stdbool.h> is the standard/modern way to define embedd/extends Python free to define bool, true and false, but there are existing applications that use slightly different redefinitions, which fail if the header is included.
It's OK to use stdbool outside the public headers, though.
https://bugs.python.org/issue46748
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0be42f3..6fa0cce 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -40,6 +40,9 @@ # error "_testcapi must test the public Python C API, not CPython internal C API" #endif +#ifdef bool +# error "The public headers should not include <stdbool.h>, see bpo-46748" +#endif // Forward declarations static struct PyModuleDef _testcapimodule; |