mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
bpo-35177: Add dependencies between header files (GH-10361)
* ast.h now includes Python-ast.h and node.h * parsetok.h now includes node.h and grammar.h * symtable.h now includes Python-ast.h * Modify asdl_c.py to enhance Python-ast.h: * Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header twice * Add "extern { ... }" for C++ * Undefine "Yield" macro conflicting with winbase.h * Remove "#undef Yield" from C files, it's now done in Python-ast.h * Remove now useless includes in C files
This commit is contained in:
parent
fd3a91cbf9
commit
5f2df88b63
13 changed files with 42 additions and 26 deletions
13
Include/Python-ast.h
generated
13
Include/Python-ast.h
generated
|
@ -1,7 +1,15 @@
|
|||
/* File automatically generated by Parser/asdl_c.py. */
|
||||
|
||||
#ifndef Py_PYTHON_AST_H
|
||||
#define Py_PYTHON_AST_H
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "asdl.h"
|
||||
|
||||
#undef Yield /* undefine macro conflicting with winbase.h */
|
||||
|
||||
typedef struct _mod *mod_ty;
|
||||
|
||||
typedef struct _stmt *stmt_ty;
|
||||
|
@ -607,3 +615,8 @@ withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena
|
|||
PyObject* PyAST_mod2obj(mod_ty t);
|
||||
mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);
|
||||
int PyAST_Check(PyObject* obj);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !Py_PYTHON_AST_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue