Skip to content

Commit 740e098

Browse files
committed
Python update linux
1 parent 5b9d787 commit 740e098

File tree

373 files changed

+43111
-10251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

373 files changed

+43111
-10251
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/thirdparty/python_linux/include/Python-ast.h

Lines changed: 0 additions & 637 deletions
This file was deleted.
Lines changed: 70 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,85 @@
1+
// Entry point of the Python C API.
2+
// C extensions should only #include <Python.h>, and not include directly
3+
// the other Python header files included by <Python.h>.
4+
15
#ifndef Py_PYTHON_H
26
#define Py_PYTHON_H
3-
/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */
47

5-
/* Include nearly all Python header files */
8+
// Since this is a "meta-include" file, "#ifdef __cplusplus / extern "C" {"
9+
// is not needed.
10+
611

12+
// Include Python header files
713
#include "patchlevel.h"
814
#include "pyconfig.h"
915
#include "pymacconfig.h"
1016

11-
#include <limits.h>
1217

13-
#ifndef UCHAR_MAX
14-
#error "Something's broken. UCHAR_MAX should be defined in limits.h."
18+
// Include standard header files
19+
#include <assert.h> // assert()
20+
#include <inttypes.h> // uintptr_t
21+
#include <limits.h> // INT_MAX
22+
#include <math.h> // HUGE_VAL
23+
#include <stdarg.h> // va_list
24+
#include <wchar.h> // wchar_t
25+
#ifdef HAVE_SYS_TYPES_H
26+
# include <sys/types.h> // ssize_t
1527
#endif
1628

17-
#if UCHAR_MAX != 255
18-
#error "Python's source code assumes C's unsigned char is an 8-bit type."
29+
// <errno.h>, <stdio.h>, <stdlib.h> and <string.h> headers are no longer used
30+
// by Python, but kept for the backward compatibility of existing third party C
31+
// extensions. They are not included by limited C API version 3.11 and newer.
32+
//
33+
// The <ctype.h> and <unistd.h> headers are not included by limited C API
34+
// version 3.13 and newer.
35+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
36+
# include <errno.h> // errno
37+
# include <stdio.h> // FILE*
38+
# include <stdlib.h> // getenv()
39+
# include <string.h> // memcpy()
1940
#endif
20-
21-
#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
22-
#define _SGI_MP_SOURCE
41+
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030d0000
42+
# include <ctype.h> // tolower()
43+
# ifndef MS_WINDOWS
44+
# include <unistd.h> // close()
45+
# endif
2346
#endif
2447

25-
#include <stdio.h>
26-
#ifndef NULL
27-
# error "Python.h requires that stdio.h define NULL."
48+
// gh-111506: The free-threaded build is not compatible with the limited API
49+
// or the stable ABI.
50+
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
51+
# error "The limited API is not currently supported in the free-threaded build"
2852
#endif
2953

30-
#include <string.h>
31-
#ifdef HAVE_ERRNO_H
32-
#include <errno.h>
33-
#endif
34-
#include <stdlib.h>
35-
#ifdef HAVE_UNISTD_H
36-
#include <unistd.h>
54+
#if defined(Py_GIL_DISABLED) && defined(_MSC_VER)
55+
# include <intrin.h> // __readgsqword()
3756
#endif
3857

39-
/* For size_t? */
40-
#ifdef HAVE_STDDEF_H
41-
#include <stddef.h>
58+
#if defined(Py_GIL_DISABLED) && defined(__MINGW32__)
59+
# include <intrin.h> // __readgsqword()
4260
#endif
4361

44-
/* CAUTION: Build setups should ensure that NDEBUG is defined on the
45-
* compiler command line when building Python in release mode; else
46-
* assert() calls won't be removed.
47-
*/
48-
#include <assert.h>
49-
62+
// Include Python header files
5063
#include "pyport.h"
5164
#include "pymacro.h"
52-
53-
#include "pyatomic.h"
54-
55-
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
56-
* PYMALLOC_DEBUG is in error if pymalloc is not in use.
57-
*/
58-
#if defined(Py_DEBUG) && defined(WITH_PYMALLOC) && !defined(PYMALLOC_DEBUG)
59-
#define PYMALLOC_DEBUG
60-
#endif
61-
#if defined(PYMALLOC_DEBUG) && !defined(WITH_PYMALLOC)
62-
#error "PYMALLOC_DEBUG requires WITH_PYMALLOC"
63-
#endif
6465
#include "pymath.h"
65-
#include "pytime.h"
6666
#include "pymem.h"
67-
67+
#include "pytypedefs.h"
68+
#include "pybuffer.h"
69+
#include "pystats.h"
70+
#include "pyatomic.h"
71+
#include "lock.h"
6872
#include "object.h"
6973
#include "objimpl.h"
7074
#include "typeslots.h"
7175
#include "pyhash.h"
72-
73-
#include "pydebug.h"
74-
76+
#include "cpython/pydebug.h"
7577
#include "bytearrayobject.h"
7678
#include "bytesobject.h"
7779
#include "unicodeobject.h"
80+
#include "pyerrors.h"
7881
#include "longobject.h"
79-
#include "longintrepr.h"
82+
#include "cpython/longintrepr.h"
8083
#include "boolobject.h"
8184
#include "floatobject.h"
8285
#include "complexobject.h"
@@ -85,52 +88,52 @@
8588
#include "tupleobject.h"
8689
#include "listobject.h"
8790
#include "dictobject.h"
88-
#include "odictobject.h"
91+
#include "cpython/odictobject.h"
8992
#include "enumobject.h"
9093
#include "setobject.h"
9194
#include "methodobject.h"
9295
#include "moduleobject.h"
93-
#include "funcobject.h"
94-
#include "classobject.h"
96+
#include "monitoring.h"
97+
#include "cpython/funcobject.h"
98+
#include "cpython/classobject.h"
9599
#include "fileobject.h"
96100
#include "pycapsule.h"
101+
#include "cpython/code.h"
102+
#include "pyframe.h"
97103
#include "traceback.h"
98104
#include "sliceobject.h"
99-
#include "cellobject.h"
105+
#include "cpython/cellobject.h"
100106
#include "iterobject.h"
101-
#include "genobject.h"
107+
#include "cpython/initconfig.h"
108+
#include "pystate.h"
109+
#include "cpython/genobject.h"
102110
#include "descrobject.h"
111+
#include "genericaliasobject.h"
103112
#include "warnings.h"
104113
#include "weakrefobject.h"
105114
#include "structseq.h"
106-
#include "namespaceobject.h"
107-
115+
#include "cpython/picklebufobject.h"
116+
#include "cpython/pytime.h"
108117
#include "codecs.h"
109-
#include "pyerrors.h"
110-
111-
#include "pystate.h"
112-
113-
#include "pyarena.h"
118+
#include "pythread.h"
119+
#include "cpython/context.h"
114120
#include "modsupport.h"
121+
#include "compile.h"
115122
#include "pythonrun.h"
116123
#include "pylifecycle.h"
117124
#include "ceval.h"
118125
#include "sysmodule.h"
119126
#include "osmodule.h"
120127
#include "intrcheck.h"
121128
#include "import.h"
122-
123129
#include "abstract.h"
124130
#include "bltinmodule.h"
125-
126-
#include "compile.h"
127-
#include "eval.h"
128-
129-
#include "pyctype.h"
131+
#include "critical_section.h"
132+
#include "cpython/pyctype.h"
130133
#include "pystrtod.h"
131134
#include "pystrcmp.h"
132-
#include "dtoa.h"
133135
#include "fileutils.h"
134-
#include "pyfpe.h"
136+
#include "cpython/pyfpe.h"
137+
#include "cpython/tracemalloc.h"
135138

136139
#endif /* !Py_PYTHON_H */

0 commit comments

Comments
 (0)