diff options
Diffstat (limited to 'Include/Python.h')
-rw-r--r-- | Include/Python.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Include/Python.h b/Include/Python.h index c0a621ad44a..6e3303ac9a3 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -16,12 +16,14 @@ # define _SGI_MP_SOURCE #endif -#include <string.h> // memcpy() -#ifndef Py_LIMITED_API +// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python +// headers, but kept for backward compatibility. They are excluded from the +// limited C API of Python 3.11. +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 +# include <stdlib.h> # include <stdio.h> // FILE* -#endif -#ifdef HAVE_ERRNO_H # include <errno.h> // errno +# include <string.h> // memcpy() #endif #ifndef MS_WINDOWS # include <unistd.h> |