|
5 | 5 | #ifndef Py_PYTHON_H |
6 | 6 | #define Py_PYTHON_H |
7 | 7 |
|
8 | | -// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { |
| 8 | +// Since this is a "meta-include" file, "#ifdef __cplusplus / extern "C" {" |
| 9 | +// is not needed. |
| 10 | + |
9 | 11 |
|
10 | 12 | // Include Python header files |
11 | 13 | #include "patchlevel.h" |
12 | 14 | #include "pyconfig.h" |
13 | 15 | #include "pymacconfig.h" |
14 | 16 |
|
15 | | -#if defined(__sgi) && !defined(_SGI_MP_SOURCE) |
16 | | -# define _SGI_MP_SOURCE |
| 17 | + |
| 18 | +// Include standard header files |
| 19 | +#include <assert.h> // assert() |
| 20 | +#include <ctype.h> // tolower() |
| 21 | +#include <inttypes.h> // uintptr_t |
| 22 | +#include <limits.h> // INT_MAX |
| 23 | +#include <stdarg.h> // va_list |
| 24 | +#include <wchar.h> // wchar_t |
| 25 | +#ifdef HAVE_STDDEF_H |
| 26 | +# include <stddef.h> // size_t |
| 27 | +#endif |
| 28 | +#ifndef MS_WINDOWS |
| 29 | +# include <unistd.h> // sysconf() |
17 | 30 | #endif |
18 | 31 |
|
19 | | -// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python |
20 | | -// headers, but kept for backward compatibility. They are excluded from the |
21 | | -// limited C API of Python 3.11. |
| 32 | +// errno.h, stdio.h, stdlib.h and string.h headers are no longer used by Python |
| 33 | +// headers, but kept for backward compatibility (no introduce new compiler |
| 34 | +// warnings). They are not included by the limited C API version 3.11 and |
| 35 | +// above. |
22 | 36 | #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 |
23 | | -# include <stdlib.h> |
24 | | -# include <stdio.h> // FILE* |
25 | 37 | # include <errno.h> // errno |
| 38 | +# include <stdio.h> // FILE* |
| 39 | +# include <stdlib.h> // getenv() |
26 | 40 | # include <string.h> // memcpy() |
27 | 41 | #endif |
28 | | -#ifndef MS_WINDOWS |
29 | | -# include <unistd.h> |
30 | | -#endif |
31 | | -#ifdef HAVE_STDDEF_H |
32 | | -# include <stddef.h> // size_t |
33 | | -#endif |
34 | 42 |
|
35 | | -#include <assert.h> // assert() |
36 | | -#include <wchar.h> // wchar_t |
37 | 43 |
|
| 44 | +// Include Python header files |
38 | 45 | #include "pyport.h" |
39 | 46 | #include "pymacro.h" |
40 | 47 | #include "pymath.h" |
41 | 48 | #include "pymem.h" |
42 | 49 | #include "pytypedefs.h" |
43 | 50 | #include "pybuffer.h" |
| 51 | +#include "pystats.h" |
44 | 52 | #include "object.h" |
45 | 53 | #include "objimpl.h" |
46 | 54 | #include "typeslots.h" |
|
0 commit comments