summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-12 00:56:19 +0100
committerGitHub <noreply@github.com>2018-11-12 00:56:19 +0100
commit5f2df88b63e50d23914e97ec778861a52abdeaad (patch)
tree23a720832fb9de901538ca03819946df679ff2cd /Python
parentfd3a91cbf93dd7bd97f01add9c90075d63cd7316 (diff)
downloadcpython-git-5f2df88b63e50d23914e97ec778861a52abdeaad.tar.gz
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
Diffstat (limited to 'Python')
-rw-r--r--Python/ast_opt.c1
-rw-r--r--Python/bltinmodule.c11
-rw-r--r--Python/compile.c1
-rw-r--r--Python/import.c1
-rw-r--r--Python/pylifecycle.c1
-rw-r--r--Python/pythonrun.c1
-rw-r--r--Python/symtable.c5
7 files changed, 2 insertions, 19 deletions
diff --git a/Python/ast_opt.c b/Python/ast_opt.c
index 1f9cb773ea..6f72a7f63b 100644
--- a/Python/ast_opt.c
+++ b/Python/ast_opt.c
@@ -1,7 +1,6 @@
/* AST Optimizer */
#include "Python.h"
#include "Python-ast.h"
-#include "node.h"
#include "ast.h"
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 6c8672adfc..6781589c29 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1,16 +1,9 @@
/* Built-in functions */
#include "Python.h"
-#include "Python-ast.h"
-#include "pycore_state.h"
-
-#include "node.h"
-#include "code.h"
-
-#include "asdl.h"
-#include "ast.h"
-
#include <ctype.h>
+#include "ast.h"
+#include "pycore_state.h"
_Py_IDENTIFIER(__builtins__);
_Py_IDENTIFIER(__dict__);
diff --git a/Python/compile.c b/Python/compile.c
index 45a8c573a5..beceeea86b 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -24,7 +24,6 @@
#include "Python.h"
#include "Python-ast.h"
-#include "node.h"
#include "ast.h"
#include "code.h"
#include "symtable.h"
diff --git a/Python/import.c b/Python/import.c
index c0ea968fb8..fcd88514ee 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -3,7 +3,6 @@
#include "Python.h"
#include "Python-ast.h"
-#undef Yield /* undefine macro conflicting with winbase.h */
#include "pycore_hash.h"
#include "pycore_lifecycle.h"
#include "pycore_mem.h"
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 4c5cb53429..318d7cb4ba 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -3,7 +3,6 @@
#include "Python.h"
#include "Python-ast.h"
-#undef Yield /* undefine macro conflicting with winbase.h */
#include "pycore_context.h"
#include "pycore_hamt.h"
#include "pycore_lifecycle.h"
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 2f61aab40d..2b9f4f0415 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -11,7 +11,6 @@
#include "Python.h"
#include "Python-ast.h"
-#undef Yield /* undefine macro conflicting with winbase.h */
#include "pycore_state.h"
#include "grammar.h"
#include "node.h"
diff --git a/Python/symtable.c b/Python/symtable.c
index 48e1515fa3..40f91789c6 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1,10 +1,5 @@
#include "Python.h"
#include "pycore_state.h"
-#ifdef Yield
-#undef Yield /* undefine conflicting macro from winbase.h */
-#endif
-#include "Python-ast.h"
-#include "code.h"
#include "symtable.h"
#include "structmember.h"