mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
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:
parent
67969f5eb8
commit
d36d6a9c18
8 changed files with 320 additions and 326 deletions
565
Python/Python-ast.c
generated
565
Python/Python-ast.c
generated
File diff suppressed because it is too large
Load diff
|
|
@ -451,8 +451,8 @@ astfold_body(asdl_stmt_seq *stmts, PyArena *ctx_, _PyASTOptimizeState *state)
|
|||
return 0;
|
||||
}
|
||||
asdl_seq_SET(values, 0, st->v.Expr.value);
|
||||
expr_ty expr = JoinedStr(values, st->lineno, st->col_offset,
|
||||
st->end_lineno, st->end_col_offset, ctx_);
|
||||
expr_ty expr = _Py_JoinedStr(values, st->lineno, st->col_offset,
|
||||
st->end_lineno, st->end_col_offset, ctx_);
|
||||
if (!expr) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include "Python.h"
|
||||
#include <ctype.h>
|
||||
#include "pycore_ast.h" // _PyAST_Validate()
|
||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||
#include "pycore_compile.h" // _PyAST_Compile()
|
||||
#include "pycore_object.h" // _Py_AddToAllObjects()
|
||||
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "Python.h"
|
||||
|
||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||
#include "pycore_import.h" // _PyImport_BootstrapImp()
|
||||
#include "pycore_initconfig.h"
|
||||
#include "pycore_pyerrors.h"
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@
|
|||
#include "Python.h"
|
||||
|
||||
#include "pycore_ast.h" // PyAST_mod2obj
|
||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||
|
||||
#include "pycore_compile.h" // _PyAST_Compile()
|
||||
#include "pycore_interp.h" // PyInterpreterState.importlib
|
||||
#include "pycore_object.h" // _PyDebug_PrintTotalRefs()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "Python.h"
|
||||
#include "pycore_ast.h" // identifier, stmt_ty
|
||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||
#include "pycore_compile.h" // _Py_Mangle()
|
||||
#include "pycore_parser.h" // _PyParser_ASTFromString()
|
||||
#include "pycore_pystate.h" // _PyThreadState_GET()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue