gh-79315: Add Include/cpython/structseq.h header (#139730)

This commit is contained in:
Victor Stinner
2025-10-08 01:19:50 +02:00
committed by GitHub
parent 5a77f02d72
commit 85ec35d2ab
5 changed files with 20 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
#ifndef Py_CPYTHON_STRUCTSEQ_H
# error "this header file must not be included directly"
#endif
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
PyStructSequence_Desc *desc);
typedef PyTupleObject PyStructSequence;
#define PyStructSequence_SET_ITEM PyStructSequence_SetItem
#define PyStructSequence_GET_ITEM PyStructSequence_GetItem

View File

@@ -21,12 +21,6 @@ typedef struct PyStructSequence_Desc {
PyAPI_DATA(const char * const) PyStructSequence_UnnamedField;
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
PyStructSequence_Desc *desc);
#endif
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
@@ -35,9 +29,9 @@ PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
#ifndef Py_LIMITED_API
typedef PyTupleObject PyStructSequence;
#define PyStructSequence_SET_ITEM PyStructSequence_SetItem
#define PyStructSequence_GET_ITEM PyStructSequence_GetItem
# define Py_CPYTHON_STRUCTSEQ_H
# include "cpython/structseq.h"
# undef Py_CPYTHON_STRUCTSEQ_H
#endif
#ifdef __cplusplus

View File

@@ -1296,6 +1296,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/pythread.h \
$(srcdir)/Include/cpython/setobject.h \
$(srcdir)/Include/cpython/sliceobject.h \
$(srcdir)/Include/cpython/structseq.h \
$(srcdir)/Include/cpython/traceback.h \
$(srcdir)/Include/cpython/tracemalloc.h \
$(srcdir)/Include/cpython/tupleobject.h \

View File

@@ -193,6 +193,7 @@
<ClInclude Include="..\Include\cpython\pythread.h" />
<ClInclude Include="..\Include\cpython\setobject.h" />
<ClInclude Include="..\Include\cpython\sliceobject.h" />
<ClInclude Include="..\Include\cpython\structseq.h" />
<ClInclude Include="..\Include\cpython\traceback.h" />
<ClInclude Include="..\Include\cpython\tracemalloc.h" />
<ClInclude Include="..\Include\cpython\tupleobject.h" />

View File

@@ -486,6 +486,9 @@
<ClInclude Include="..\Include\cpython\pylifecycle.h">
<Filter>Include\cpython</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\structseq.h">
<Filter>Include\cpython</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\tupleobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>