bpo-43244: Remove Yield macro from pycore_ast.h (GH-25243)

* pycore_ast.h no longer defines the Yield macro.
* Fix a compiler warning on Windows: "warning C4005: 'Yield': macro
  redefinition".
* Python-ast.c now defines directly functions with their real
  _Py_xxx() name, rather than xxx().
* Remove "#undef Yield" in C files including pycore_ast.h.
This commit is contained in:
Victor Stinner 2021-04-07 13:01:09 +02:00 • committed by GitHub
parent 67969f5eb8
commit d36d6a9c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 320 additions and 326 deletions

View file

@ -12,8 +12,6 @@ extern "C" {
#include "pycore_asdl.h"
#undef Yield /* undefine macro conflicting with <winbase.h> */
typedef struct _mod *mod_ty;
typedef struct _stmt *stmt_ty;
@ -729,7 +727,6 @@ expr_ty _Py_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int
#define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5)
expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
#define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5)
expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno,
int end_col_offset, PyArena *arena);
#define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5)