mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
gh-112026: Add again <unistd.h> include in Python.h (#112046)
Add again <ctype.h> and <unistd.h> includes in Python.h, but don't include them in the limited C API version 3.13 and newer.
This commit is contained in:
parent
4bbb367ba6
commit
b338ffa4bc
3 changed files with 15 additions and 21 deletions
|
|
@ -26,15 +26,24 @@
|
|||
# include <sys/types.h> // ssize_t
|
||||
#endif
|
||||
|
||||
// errno.h, stdio.h, stdlib.h and string.h headers are no longer used by
|
||||
// Python, but kept for backward compatibility (avoid compiler warnings).
|
||||
// They are no longer included by limited C API version 3.11 and newer.
|
||||
// <errno.h>, <stdio.h>, <stdlib.h> and <string.h> headers are no longer used
|
||||
// by Python, but kept for the backward compatibility of existing third party C
|
||||
// extensions. They are not included by limited C API version 3.11 and newer.
|
||||
//
|
||||
// The <ctype.h> and <unistd.h> headers are not included by limited C API
|
||||
// version 3.13 and newer.
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
|
||||
# include <errno.h> // errno
|
||||
# include <stdio.h> // FILE*
|
||||
# include <stdlib.h> // getenv()
|
||||
# include <string.h> // memcpy()
|
||||
#endif
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030d0000
|
||||
# include <ctype.h> // tolower()
|
||||
# ifndef MS_WINDOWS
|
||||
# include <unistd.h> // close()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
// Include Python header files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue