]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix compiler warning on Windows (GH-18012)
authorAmmar Askar <ammar@ammaraskar.com>
Wed, 15 Jan 2020 16:48:40 +0000 (11:48 -0500)
committerZachary Ware <zach@python.org>
Wed, 15 Jan 2020 16:48:40 +0000 (10:48 -0600)
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.

Python/compile.c

index 3138a3f50dd1c689b5350bbe9b332f6741b17879..1d16e69a08556cf9340a4723c299988409c96e24 100644 (file)
@@ -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"