diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2024-06-24 09:23:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 09:23:38 (GMT) |
commit | 65a12c559cbc13c2c5a4aa65c76310bd8d2051a7 (patch) | |
tree | b244c6b535201b29b5e5e1ecaede6bc89ad4170f /Include/cpython | |
parent | c38e2f64d012929168dfef7363c9e48bd1a6c731 (diff) | |
download | cpython-65a12c559cbc13c2c5a4aa65c76310bd8d2051a7.zip cpython-65a12c559cbc13c2c5a4aa65c76310bd8d2051a7.tar.gz cpython-65a12c559cbc13c2c5a4aa65c76310bd8d2051a7.tar.bz2 |
gh-120834: fix type of *_iframe field in _PyGenObject_HEAD declaration (#120835)
Diffstat (limited to 'Include/cpython')
-rw-r--r-- | Include/cpython/genobject.h | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/Include/cpython/genobject.h b/Include/cpython/genobject.h index 49e46c2..f75884e 100644 --- a/Include/cpython/genobject.h +++ b/Include/cpython/genobject.h @@ -9,29 +9,7 @@ extern "C" { /* --- Generators --------------------------------------------------------- */ -/* _PyGenObject_HEAD defines the initial segment of generator - and coroutine objects. */ -#define _PyGenObject_HEAD(prefix) \ - PyObject_HEAD \ - /* List of weak reference. */ \ - PyObject *prefix##_weakreflist; \ - /* Name of the generator. */ \ - PyObject *prefix##_name; \ - /* Qualified name of the generator. */ \ - PyObject *prefix##_qualname; \ - _PyErr_StackItem prefix##_exc_state; \ - PyObject *prefix##_origin_or_finalizer; \ - char prefix##_hooks_inited; \ - char prefix##_closed; \ - char prefix##_running_async; \ - /* The frame */ \ - int8_t prefix##_frame_state; \ - PyObject *prefix##_iframe[1]; \ - -typedef struct { - /* The gi_ prefix is intended to remind of generator-iterator. */ - _PyGenObject_HEAD(gi) -} PyGenObject; +typedef struct _PyGenObject PyGenObject; PyAPI_DATA(PyTypeObject) PyGen_Type; @@ -46,9 +24,7 @@ PyAPI_FUNC(PyCodeObject *) PyGen_GetCode(PyGenObject *gen); /* --- PyCoroObject ------------------------------------------------------- */ -typedef struct { - _PyGenObject_HEAD(cr) -} PyCoroObject; +typedef struct _PyCoroObject PyCoroObject; PyAPI_DATA(PyTypeObject) PyCoro_Type; @@ -59,9 +35,7 @@ PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, /* --- Asynchronous Generators -------------------------------------------- */ -typedef struct { - _PyGenObject_HEAD(ag) -} PyAsyncGenObject; +typedef struct _PyAsyncGenObject PyAsyncGenObject; PyAPI_DATA(PyTypeObject) PyAsyncGen_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; @@ -73,7 +47,6 @@ PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, #define PyAsyncGenASend_CheckExact(op) Py_IS_TYPE((op), &_PyAsyncGenASend_Type) - #undef _PyGenObject_HEAD #ifdef __cplusplus |