bpo-43916: Move the _PyStructSequence_InitType function to the intern… · python/cpython@c2931d3 (original) (raw)

10 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -918,7 +918,6 @@ Py_tp_setattro
918 918 Py_tp_str
919 919 Py_tp_traverse
920 920 Py_uintptr_t
921 -_PyStructSequence_InitType
922 921 _frame
923 922 _node
924 923 allocfunc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1 +#ifndef Py_INTERNAL_STRUCTSEQ_H
2 +#define Py_INTERNAL_STRUCTSEQ_H
3 +#ifdef __cplusplus
4 +extern "C" {
5 +#endif
6 +
7 +#ifndef Py_BUILD_CORE
8 +# error "this header requires Py_BUILD_CORE define"
9 +#endif
10 +
11 +
12 +PyAPI_FUNC(int) _PyStructSequence_InitType(
13 +PyTypeObject *type,
14 +PyStructSequence_Desc *desc,
15 +unsigned long tp_flags);
16 +
17 +
18 +#ifdef __cplusplus
19 +}
20 +#endif
21 +#endif /* !Py_INTERNAL_STRUCTSEQ_H */
Original file line number Diff line number Diff line change
@@ -27,10 +27,6 @@ PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
27 27 PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
28 28 PyStructSequence_Desc *desc);
29 29 #endif
30 -PyAPI_FUNC(int) _PyStructSequence_InitType(
31 -PyTypeObject *type,
32 -PyStructSequence_Desc *desc,
33 -unsigned long tp_flags);
34 30 PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
35 31
36 32 PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
Original file line number Diff line number Diff line change
@@ -1171,6 +1171,7 @@ PYTHON_HEADERS= \
1171 1171 $(srcdir)/Include/internal/pycore_pymem.h \
1172 1172 $(srcdir)/Include/internal/pycore_pystate.h \
1173 1173 $(srcdir)/Include/internal/pycore_runtime.h \
1174 + $(srcdir)/Include/internal/pycore_structseq.h \
1174 1175 $(srcdir)/Include/internal/pycore_symtable.h \
1175 1176 $(srcdir)/Include/internal/pycore_sysmodule.h \
1176 1177 $(srcdir)/Include/internal/pycore_traceback.h \
Original file line number Diff line number Diff line change
@@ -2121,8 +2121,6 @@ function PyObject_GetAiter
2121 2121 added 3.10
2122 2122 data PyExc_EncodingWarning
2123 2123 added 3.10
2124 -function _PyStructSequence_InitType
2125 - added 3.10
2126 2124
2127 2125 # Support for Stable ABI in debug builds
2128 2126
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ static const char PyCursesVersion[] = "2.2";
104 104
105 105 #include "Python.h"
106 106 #include "pycore_long.h" // _PyLong_GetZero()
107 -
107 +#include "pycore_structseq.h" // PyStructSequence_InitType()
108 108
109 109 #ifdef __hpux
110 110 #define STRICT_SYSV_CURSES
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
11 11 #include "pycore_tuple.h" // _PyTuple_FromArray()
12 12 #include "pycore_object.h" // _PyObject_GC_TRACK()
13 13 #include "structmember.h" // PyMemberDef
14 +#include "pycore_structseq.h" // PyStructSequence_InitType()
14 15
15 16 static const char visible_length_key[] = "n_sequence_fields";
16 17 static const char real_length_key[] = "n_fields";
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ EXPORT_FUNC(_PyObject_GC_Resize)
35 35 EXPORT_FUNC(_PyObject_New)
36 36 EXPORT_FUNC(_PyObject_NewVar)
37 37 EXPORT_FUNC(_PyState_AddModule)
38 -EXPORT_FUNC(_PyStructSequence_InitType)
39 38 EXPORT_FUNC(_PyThreadState_Init)
40 39 EXPORT_FUNC(_PyThreadState_Prealloc)
41 40 EXPORT_FUNC(_PyTrash_deposit_object)
Original file line number Diff line number Diff line change
@@ -209,6 +209,7 @@
209 209 <ClInclude Include="..\Include\internal\pycore_pymem.h" />
210 210 <ClInclude Include="..\Include\internal\pycore_pystate.h" />
211 211 <ClInclude Include="..\Include\internal\pycore_runtime.h" />
212 + <ClInclude Include="..\Include\internal\pycore_structseq.h" />
212 213 <ClInclude Include="..\Include\internal\pycore_sysmodule.h" />
213 214 <ClInclude Include="..\Include\internal\pycore_symtable.h" />
214 215 <ClInclude Include="..\Include\internal\pycore_traceback.h" />
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@ Data members:
24 24 #include "pycore_pymem.h" // _PyMem_SetDefaultAllocator()
25 25 #include "pycore_pystate.h" // _PyThreadState_GET()
26 26 #include "pycore_tuple.h" // _PyTuple_FromArray()
27 +#include "pycore_structseq.h" // PyStructSequence_InitType()
27 28
28 29 #include "code.h"
29 30 #include "frameobject.h" // PyFrame_GetBack()