From a7411025c5152e638b01eef0f0f5a6bf9352b46d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 20 Mar 2025 00:13:25 +0100 Subject: gh-131238: Use pycore_interp_structs.h header (#131481) Replace pycore_runtime_structs.h include with pycore_interp_structs.h include in internal headers. --- Include/internal/pycore_codecs.h | 2 +- Include/internal/pycore_fileutils.h | 2 +- Include/internal/pycore_gc.h | 4 ++-- Include/internal/pycore_import.h | 4 ++-- Include/internal/pycore_interp.h | 3 --- Include/internal/pycore_runtime.h | 3 ++- Include/internal/pycore_time.h | 2 +- Include/internal/pycore_typeobject.h | 2 +- 8 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Include/internal/pycore_codecs.h b/Include/internal/pycore_codecs.h index 7c44a44..01b31d3 100644 --- a/Include/internal/pycore_codecs.h +++ b/Include/internal/pycore_codecs.h @@ -8,8 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif +#include "pycore_interp_structs.h" // struct codecs_state #include "pycore_lock.h" // PyMutex -#include "pycore_runtime_structs.h" // struct codecs_state /* Initialize codecs-related state for the given interpreter, including registering the first codec search function. Must be called before any other diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h index 1ef2358..2c6d6da 100644 --- a/Include/internal/pycore_fileutils.h +++ b/Include/internal/pycore_fileutils.h @@ -9,7 +9,7 @@ extern "C" { #endif #include // struct lconv -#include "pycore_runtime_structs.h" // _Py_error_handler +#include "pycore_interp_structs.h" // _Py_error_handler /* A routine to check if a file descriptor can be select()-ed. */ diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h index c33b98c..96b3bc2 100644 --- a/Include/internal/pycore_gc.h +++ b/Include/internal/pycore_gc.h @@ -8,8 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_pystate.h" -#include "pycore_runtime_structs.h" +#include "pycore_interp_structs.h" // PyGC_Head +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_typedefs.h" // _PyInterpreterFrame diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h index 2b68228..f99ab59 100644 --- a/Include/internal/pycore_import.h +++ b/Include/internal/pycore_import.h @@ -9,9 +9,9 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_lock.h" // PyMutex -#include "pycore_runtime_structs.h" // _import_state #include "pycore_hashtable.h" // _Py_hashtable_t +#include "pycore_interp_structs.h" // _import_state +#include "pycore_lock.h" // PyMutex extern int _PyImport_IsInitialized(PyInterpreterState *); diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index eb8ed2e..49eedd8 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -8,9 +8,6 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include // bool - -#include "pycore_runtime_structs.h" #include "pycore_genobject.h" // _PyGen_FetchStopIterationValue diff --git a/Include/internal/pycore_runtime.h b/Include/internal/pycore_runtime.h index bda8a30..7fc7f34 100644 --- a/Include/internal/pycore_runtime.h +++ b/Include/internal/pycore_runtime.h @@ -8,7 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_runtime_structs.h" +#include "pycore_runtime_structs.h" // _PyRuntimeState + /* API */ diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h index f50c43d..2331247 100644 --- a/Include/internal/pycore_time.h +++ b/Include/internal/pycore_time.h @@ -57,7 +57,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_runtime_structs.h" +#include "pycore_runtime_structs.h" // _PyTimeFraction #ifdef __clang__ struct timeval; diff --git a/Include/internal/pycore_typeobject.h b/Include/internal/pycore_typeobject.h index a5bea71..cd36400 100644 --- a/Include/internal/pycore_typeobject.h +++ b/Include/internal/pycore_typeobject.h @@ -9,8 +9,8 @@ extern "C" { #endif #include "pycore_function.h" +#include "pycore_interp_structs.h" // managed_static_type_state #include "pycore_moduleobject.h" // PyModuleObject -#include "pycore_runtime_structs.h" // type state #include "pycore_stats.h" -- cgit v0.12