| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -565,6 +565,13 @@ Porting to Python 3.11 | |||
| 565 | 565 | ``exit()`` and ``abort()``. | |
| 566 | 566 | (Contributed by Victor Stinner in :issue:`45434`.) | |
| 567 | 567 | ||
| 568 | + * The ``<Python.h>`` header file no longer includes ``<stdio.h>`` if the | ||
| 569 | + ``Py_LIMITED_API`` macro is defined. Functions expecting ``FILE*`` are | ||
| 570 | + excluded from the limited C API (:pep:`384`). C extensions using | ||
| 571 | + ``<stdio.h>`` must now include it explicitly. The system ``<stdio.h>`` | ||
| 572 | + header provides functions like ``printf()`` and ``fopen()``. | ||
| 573 | + (Contributed by Victor Stinner in :issue:`45434`.) | ||
| 574 | + | ||
| 568 | 575 | Deprecated | |
| 569 | 576 | ---------- | |
| 570 | 577 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,21 +16,18 @@ | |||
| 16 | 16 | # define _SGI_MP_SOURCE | |
| 17 | 17 | #endif | |
| 18 | 18 | ||
| 19 | - #include <stdio.h> // NULL, FILE* | ||
| 20 | - #ifndef NULL | ||
| 21 | - # error "Python.h requires that stdio.h define NULL." | ||
| 22 | - #endif | ||
| 23 | - | ||
| 24 | 19 | #include <string.h> // memcpy() | |
| 20 | + #ifndef Py_LIMITED_API | ||
| 21 | + # include <stdio.h> // FILE* | ||
| 22 | + #endif | ||
| 25 | 23 | #ifdef HAVE_ERRNO_H | |
| 26 | 24 | # include <errno.h> // errno | |
| 27 | 25 | #endif | |
| 28 | 26 | #ifndef MS_WINDOWS | |
| 29 | 27 | # include <unistd.h> | |
| 30 | 28 | #endif | |
| 31 | 29 | #ifdef HAVE_STDDEF_H | |
| 32 | - // For size_t | ||
| 33 | - # include <stddef.h> | ||
| 30 | + # include <stddef.h> // size_t | ||
| 34 | 31 | #endif | |
| 35 | 32 | ||
| 36 | 33 | #include <assert.h> // assert() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + The ``<Python.h>`` header file no longer includes ``<stdio.h>`` if the | ||
| 2 | + ``Py_LIMITED_API`` macro is defined. Functions expecting ``FILE*`` are excluded | ||
| 3 | + from the limited C API (:pep:`384`). C extensions using ``<stdio.h>`` must now | ||
| 4 | + include it explicitly. | ||
| 5 | + Patch by Victor Stinner. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments