mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	bpo-35177, Python-ast.h: Fix "Yield" compiler warning (GH-10664)
Partially revert commit 5f2df88b63:
add "#undef Yield" to .c files after including Python-ast.h.
Fix the warning:
    winbase.h(102): warning C4005: 'Yield': macro redefinition
			
			
This commit is contained in:
		
							parent
							
								
									2cf5d32fd9
								
							
						
					
					
						commit
						3bb183d7fb
					
				
					 8 changed files with 8 additions and 2 deletions
				
			
		
							
								
								
									
										2
									
								
								Include/Python-ast.h
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								Include/Python-ast.h
									
										
									
										generated
									
									
									
								
							|  | @ -8,7 +8,7 @@ extern "C" { | |||
| 
 | ||||
| #include "asdl.h" | ||||
| 
 | ||||
| #undef Yield /* undefine macro conflicting with winbase.h */ | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| 
 | ||||
| typedef struct _mod *mod_ty; | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,6 +32,7 @@ | |||
| 
 | ||||
| #include "Python.h"                     /* general Python API             */ | ||||
| #include "Python-ast.h"                 /* mod_ty */ | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "ast.h" | ||||
| #include "graminit.h"                   /* symbols defined in the grammar */ | ||||
| #include "node.h"                       /* internal parser structure      */ | ||||
|  |  | |||
|  | @ -1247,7 +1247,7 @@ def main(srcfile, dump_module=False): | |||
|             f.write('\n') | ||||
|             f.write('#include "asdl.h"\n') | ||||
|             f.write('\n') | ||||
|             f.write('#undef Yield /* undefine macro conflicting with winbase.h */\n') | ||||
|             f.write('#undef Yield   /* undefine macro conflicting with <winbase.h> */\n') | ||||
|             f.write('\n') | ||||
|             c = ChainOfVisitors(TypeDefVisitor(f), | ||||
|                                 StructVisitor(f), | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
| #include "Python.h" | ||||
| #include <ctype.h> | ||||
| #include "ast.h" | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "pycore_pystate.h" | ||||
| 
 | ||||
| _Py_IDENTIFIER(__builtins__); | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
| #include "Python.h" | ||||
| 
 | ||||
| #include "Python-ast.h" | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "pycore_pyhash.h" | ||||
| #include "pycore_pylifecycle.h" | ||||
| #include "pycore_pymem.h" | ||||
|  |  | |||
|  | @ -3,6 +3,7 @@ | |||
| #include "Python.h" | ||||
| 
 | ||||
| #include "Python-ast.h" | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "pycore_context.h" | ||||
| #include "pycore_hamt.h" | ||||
| #include "pycore_pathconfig.h" | ||||
|  |  | |||
|  | @ -11,6 +11,7 @@ | |||
| #include "Python.h" | ||||
| 
 | ||||
| #include "Python-ast.h" | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "pycore_pystate.h" | ||||
| #include "grammar.h" | ||||
| #include "node.h" | ||||
|  |  | |||
|  | @ -1,6 +1,7 @@ | |||
| #include "Python.h" | ||||
| #include "pycore_pystate.h" | ||||
| #include "symtable.h" | ||||
| #undef Yield   /* undefine macro conflicting with <winbase.h> */ | ||||
| #include "structmember.h" | ||||
| 
 | ||||
| /* error strings used for warnings */ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner