gh-79315: Add Include/cpython/structseq.h header · python/cpython@54d970a · GitHub
Skip to content

Commit 54d970a

Browse files
committed
gh-79315: Add Include/cpython/structseq.h header
1 parent 5a77f02 commit 54d970a

5 files changed

Lines changed: 20 additions & 9 deletions

File tree

Include/cpython/structseq.h

Lines changed: 12 additions & 0 deletions

Include/structseq.h

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ typedef struct PyStructSequence_Desc {
2121

2222
PyAPI_DATA(const char * const) PyStructSequence_UnnamedField;
2323

24-
#ifndef Py_LIMITED_API
25-
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
26-
PyStructSequence_Desc *desc);
27-
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
28-
PyStructSequence_Desc *desc);
29-
#endif
3024
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
3125

3226
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
@@ -35,9 +29,9 @@ PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
3529
PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
3630

3731
#ifndef Py_LIMITED_API
38-
typedef PyTupleObject PyStructSequence;
39-
#define PyStructSequence_SET_ITEM PyStructSequence_SetItem
40-
#define PyStructSequence_GET_ITEM PyStructSequence_GetItem
32+
# define Py_CPYTHON_STRUCTSEQ_H
33+
# include "cpython/structseq.h"
34+
# undef Py_CPYTHON_STRUCTSEQ_H
4135
#endif
4236

4337
#ifdef __cplusplus

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ PYTHON_HEADERS= \
12961296
$(srcdir)/Include/cpython/pythread.h \
12971297
$(srcdir)/Include/cpython/setobject.h \
12981298
$(srcdir)/Include/cpython/sliceobject.h \
1299+
$(srcdir)/Include/cpython/structseq.h \
12991300
$(srcdir)/Include/cpython/traceback.h \
13001301
$(srcdir)/Include/cpython/tracemalloc.h \
13011302
$(srcdir)/Include/cpython/tupleobject.h \

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@
193193
<ClInclude Include="..\Include\cpython\pythread.h" />
194194
<ClInclude Include="..\Include\cpython\setobject.h" />
195195
<ClInclude Include="..\Include\cpython\sliceobject.h" />
196+
<ClInclude Include="..\Include\cpython\structseq.h" />
196197
<ClInclude Include="..\Include\cpython\traceback.h" />
197198
<ClInclude Include="..\Include\cpython\tracemalloc.h" />
198199
<ClInclude Include="..\Include\cpython\tupleobject.h" />

PCbuild/pythoncore.vcxproj.filters

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)