]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45434: Python.h no longer includes <stdlib.h> (GH-28888)
authorVictor Stinner <vstinner@python.org>
Mon, 11 Oct 2021 21:30:00 +0000 (23:30 +0200)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 21:30:00 +0000 (23:30 +0200)
Doc/whatsnew/3.11.rst
Include/Python.h
Misc/NEWS.d/next/C API/2021-10-11-23-03-49.bpo-45434.tsS8I_.rst [new file with mode: 0644]

index 2262d42a99add1936a5fac8e3a8f6ef5bf0e9fa3..1455a598e1b3c8985a6c2fc0517c2ce622c5b263 100644 (file)
@@ -552,6 +552,10 @@ Porting to Python 3.11
 
   (Contributed by Victor Stinner in :issue:`39573`.)
 
+* The ``<Python.h>`` header file no longer includes ``<stdlib.h>``. C
+  extensions using ``<stdlib.h>`` must now include it explicitly.
+  (Contributed by Victor Stinner in :issue:`45434`.)
+
 Deprecated
 ----------
 
index fa77521d46ebbeafe29c129311baae7b6ad9cf4b..8c84c90f9a57e68dd889691b0ad36054e9c37d30 100644 (file)
@@ -25,7 +25,6 @@
 #ifdef HAVE_ERRNO_H
 #  include <errno.h>              // errno
 #endif
-#include <stdlib.h>
 #ifndef MS_WINDOWS
 #  include <unistd.h>
 #endif
diff --git a/Misc/NEWS.d/next/C API/2021-10-11-23-03-49.bpo-45434.tsS8I_.rst b/Misc/NEWS.d/next/C API/2021-10-11-23-03-49.bpo-45434.tsS8I_.rst
new file mode 100644 (file)
index 0000000..c04dda5
--- /dev/null
@@ -0,0 +1,3 @@
+The ``<Python.h>`` header file no longer includes ``<stdlib.h>``. C
+extensions using ``<stdlib.h>`` must now include it explicitly. Patch by
+Victor Stinner.