From 3bb183d7fb83ad6a84ec13dea90f95d67be35c69 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 22 Nov 2018 18:38:38 +0100 Subject: bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664) Partially revert commit 5f2df88b63e50d23914e97ec778861a52abdeaad: add "#undef Yield" to .c files after including Python-ast.h. Fix the warning: winbase.h(102): warning C4005: 'Yield': macro redefinition --- Python/bltinmodule.c | 1 + Python/import.c | 1 + Python/pylifecycle.c | 1 + Python/pythonrun.c | 1 + Python/symtable.c | 1 + 5 files changed, 5 insertions(+) (limited to 'Python') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 14550fd233f..f0d342ae92d 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -3,6 +3,7 @@ #include "Python.h" #include #include "ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pystate.h" _Py_IDENTIFIER(__builtins__); diff --git a/Python/import.c b/Python/import.c index f7c37aa353c..15637c6a1f3 100644 --- a/Python/import.c +++ b/Python/import.c @@ -3,6 +3,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 58e16473100..af3d5ef055f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -3,6 +3,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_context.h" #include "pycore_hamt.h" #include "pycore_pathconfig.h" diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 1bf822ceadb..2d5dc88c5c7 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -11,6 +11,7 @@ #include "Python.h" #include "Python-ast.h" +#undef Yield /* undefine macro conflicting with */ #include "pycore_pystate.h" #include "grammar.h" #include "node.h" diff --git a/Python/symtable.c b/Python/symtable.c index 96f7bcda5e2..677b6043438 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,6 +1,7 @@ #include "Python.h" #include "pycore_pystate.h" #include "symtable.h" +#undef Yield /* undefine macro conflicting with */ #include "structmember.h" /* error strings used for warnings */ -- cgit v1.2.3