bpo-35177: Add dependencies between header files#10361
Merged
vstinner merged 1 commit intopython:masterfrom Nov 11, 2018
vstinner:header_dep
Merged
bpo-35177: Add dependencies between header files#10361vstinner merged 1 commit intopython:masterfrom vstinner:header_dep
vstinner merged 1 commit intopython:masterfrom
vstinner:header_dep
Conversation
Member
Author
|
I added the "skip news" label: my changes don't impact the public C API, and is not backward incompatible. |
* ast.h now includes Python-ast.h and node.h
* parsetok.h now includes node.h and grammar.h
* symtable.h now includes Python-ast.h
* Modify asdl_c.py to enhance Python-ast.h:
* Add #ifndef/#define Py_PYTHON_AST_H to be able to include the header
twice
* Add "extern { ... }" for C++
* Undefine "Yield" macro conflicting with winbase.h
* Remove "#undef Yield" from C files, it's now done in Python-ast.h
* Remove now useless includes in C files
Member
Author
|
@serhiy-storchaka @ncoghlan: I tried to go further in this PR, but also add more missing includes. Tell if it looks better than my previous attempt, or if you prefer to leave C file unchanged for example (only remove #undef Yield?). |
Member
Author
|
I plan to merge this PR next week if I don't get feedback before. |
ncoghlan
approved these changes
Nov 11, 2018
Member
Author
|
This PR doesn't try to fix "all dependencies issues", but it fix a few of them :-) See https://bugs.python.org/issue35197 for another example of funny header issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ast.h now includes Python-ast.h and node.h
parsetok.h now includes node.h and grammar.h
symtable.h now includes Python-ast.h
Modify asdl_c.py to enhance Python-ast.h:
twice
Remove "#undef Yield" from C files, it's now done in Python-ast.h
Remove now useless includes in C files
https://bugs.python.org/issue35177