summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-14 23:09:06 (GMT)
committerGitHub <noreply@github.com>2021-10-14 23:09:06 (GMT)
commit284994762d820d8e09cc019f8f7c4bc501e37dd4 (patch)
tree0ccb6119fb1f2e0b50b1dc9a9b7b75ff71272020 /Include
parentaf1083e975b9627a5c97013d3a2b9aef0e4b333c (diff)
downloadcpython-284994762d820d8e09cc019f8f7c4bc501e37dd4.zip
cpython-284994762d820d8e09cc019f8f7c4bc501e37dd4.tar.gz
cpython-284994762d820d8e09cc019f8f7c4bc501e37dd4.tar.bz2
bpo-45434: Limited Python.h no longer includes stdio.h (GH-28960)
The <Python.h> header file no longer includes <stdio.h> if the Py_LIMITED_API macro is defined.
Diffstat (limited to 'Include')
-rw-r--r--Include/Python.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/Include/Python.h b/Include/Python.h
index 4f62103..dc5c9b8 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -16,12 +16,10 @@
# define _SGI_MP_SOURCE
#endif
-#include <stdio.h> // NULL, FILE*
-#ifndef NULL
-# error "Python.h requires that stdio.h define NULL."
-#endif
-
#include <string.h> // memcpy()
+#ifndef Py_LIMITED_API
+# include <stdio.h> // FILE*
+#endif
#ifdef HAVE_ERRNO_H
# include <errno.h> // errno
#endif
@@ -29,8 +27,7 @@
# include <unistd.h>
#endif
#ifdef HAVE_STDDEF_H
- // For size_t
-# include <stddef.h>
+# include <stddef.h> // size_t
#endif
#include <assert.h> // assert()