From 92135775ce12fd71f0878c0a8a0652c197fcc60b Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 15 Jan 2020 09:07:09 -0800 Subject: [PATCH] Fix compiler warning on Windows (GH-18012) Python-ast.h contains a macro named Yield that conflicts with the Yield macro in Windows system headers. While Python-ast.h has an "undef Yield" directive to prevent this, it means that Python-ast.h must be included before Windows header files or we run into a re-declaration warning. In commit c96be811fa7d an include for pycore_pystate.h was added which indirectly includes Windows header files. In this commit we re-order the includes to fix this warning. (cherry picked from commit e92d39303feb1d3b4194c6a8275b1fc63b2153b2) Co-authored-by: Ammar Askar --- Python/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/compile.c b/Python/compile.c index f09e99fd4a43..11974c3509a3 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -23,8 +23,8 @@ #include "Python.h" -#include "Python-ast.h" #include "pycore_pystate.h" /* _PyInterpreterState_GET_UNSAFE() */ +#include "Python-ast.h" #include "ast.h" #include "code.h" #include "symtable.h" -- 2.47.3