gh-130931: Add pycore_typedefs.h internal header (#131396)

Declare _PyInterpreterFrame and _PyRuntimeState types before
declaring their structure members. Break reference cycles between
header files.
This commit is contained in:
Victor Stinner 2025-03-19 15:23:32 +01:00 committed by GitHub
parent a0478c9f0c
commit b8367e7cf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 57 additions and 28 deletions

View file

@ -9,6 +9,8 @@ extern "C" {
#endif
#include "pycore_frame.h"
#include "pycore_typedefs.h" // _PyInterpreterFrame
/* _PyGenObject_HEAD defines the initial segment of generator
and coroutine objects. */
@ -27,7 +29,7 @@ extern "C" {
char prefix##_running_async; \
/* The frame */ \
int8_t prefix##_frame_state; \
struct _PyInterpreterFrame prefix##_iframe; \
_PyInterpreterFrame prefix##_iframe; \
struct _PyGenObject {
/* The gi_ prefix is intended to remind of generator-iterator. */