diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast_state.h similarity index 98% rename from Include/internal/pycore_ast.h rename to Include/internal/pycore_ast_state.h index 2d0c5fb97a7..c5ae2242177 100644 --- a/Include/internal/pycore_ast.h +++ b/Include/internal/pycore_ast_state.h @@ -1,7 +1,7 @@ // File automatically generated by Parser/asdl_c.py. -#ifndef Py_INTERNAL_AST_H -#define Py_INTERNAL_AST_H +#ifndef Py_INTERNAL_AST_STATE_H +#define Py_INTERNAL_AST_STATE_H #ifdef __cplusplus extern "C" { #endif @@ -240,5 +240,5 @@ struct ast_state { #ifdef __cplusplus } #endif -#endif /* !Py_INTERNAL_AST_H */ +#endif /* !Py_INTERNAL_AST_STATE_H */ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index ea770daedd8..1e4b3ff71ee 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -9,7 +9,7 @@ extern "C" { #endif #include "pycore_atomic.h" // _Py_atomic_address -#include "pycore_ast.h" // struct ast_state +#include "pycore_ast_state.h" // struct ast_state #include "pycore_gil.h" // struct _gil_runtime_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_warnings.h" // struct _warnings_runtime_state diff --git a/Makefile.pre.in b/Makefile.pre.in index 50bd75c63a4..ee93ab6ca15 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -854,11 +854,11 @@ regen-ast: $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ $(srcdir)/Parser/Python.asdl \ -H $(srcdir)/Include/Python-ast.h.new \ - -I $(srcdir)/Include/internal/pycore_ast.h.new \ + -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ -C $(srcdir)/Python/Python-ast.c.new $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new - $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new .PHONY: regen-opcode @@ -1135,6 +1135,7 @@ PYTHON_HEADERS= \ \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_ast_state.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_atomic_funcs.h \ $(srcdir)/Include/internal/pycore_bitutils.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 92355a886d9..655c831ed5f 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -175,6 +175,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index d0b69dbc5b6..fba4af536fe 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -486,6 +486,9 @@ Include\internal + + Include\internal + Include\internal diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 936f5fd2464..166468a93bf 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -137,7 +137,7 @@ - + @@ -163,15 +163,15 @@ - - + + - + @@ -209,7 +209,7 @@ - + diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 8c167bc79c7..e96f1f35045 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1429,7 +1429,7 @@ def generate_module_def(mod, f, internal_h): print(textwrap.dedent(f""" #ifdef Py_BUILD_CORE - # include "pycore_ast.h" // struct ast_state + # include "pycore_ast_state.h" // struct ast_state # include "pycore_interp.h" // _PyInterpreterState.ast # include "pycore_pystate.h" // _PyInterpreterState_GET() #else @@ -1522,8 +1522,8 @@ def write_header(mod, f): def write_internal_h_header(mod, f): print(textwrap.dedent(""" - #ifndef Py_INTERNAL_AST_H - #define Py_INTERNAL_AST_H + #ifndef Py_INTERNAL_AST_STATE_H + #define Py_INTERNAL_AST_STATE_H #ifdef __cplusplus extern "C" { #endif @@ -1540,7 +1540,7 @@ def write_internal_h_footer(mod, f): #ifdef __cplusplus } #endif - #endif /* !Py_INTERNAL_AST_H */ + #endif /* !Py_INTERNAL_AST_STATE_H */ """), file=f) diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 439da8f2512..59acce79684 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -6,7 +6,7 @@ #include "Python.h" #ifdef Py_BUILD_CORE -# include "pycore_ast.h" // struct ast_state +# include "pycore_ast_state.h" // struct ast_state # include "pycore_interp.h" // _PyInterpreterState.ast # include "pycore_pystate.h" // _PyInterpreterState_GET() #else