diff options
author | Tal Einat <taleinat@gmail.com> | 2017-11-03 09:09:00 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-11-03 09:09:00 (GMT) |
commit | 4f57409a2f7bdf8fb559cddc7c6533ca2c471c67 (patch) | |
tree | fe4ded27d3d8ade96a60a849ddce32c6facfbc6e /Tools | |
parent | 700d2e4755921d6c339ff20dacecde1aea64de34 (diff) | |
download | cpython-4f57409a2f7bdf8fb559cddc7c6533ca2c471c67.zip cpython-4f57409a2f7bdf8fb559cddc7c6533ca2c471c67.tar.gz cpython-4f57409a2f7bdf8fb559cddc7c6533ca2c471c67.tar.bz2 |
bpo-31926: fix missing *_METHODDEF statements by argument clinic (#4230)
When a single .c file contains several functions and/or methods with
the same name, a safety _METHODDEF #define statement is generated
only for one of them.
This fixes the bug by using the full name of the function to avoid
duplicates rather than just the name.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/clinic/clinic.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 91d8440..4cdfebb 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -957,8 +957,8 @@ class CLanguage(Language): cpp_if = "#if " + conditional cpp_endif = "#endif /* " + conditional + " */" - if methoddef_define and f.name not in clinic.ifndef_symbols: - clinic.ifndef_symbols.add(f.name) + if methoddef_define and f.full_name not in clinic.ifndef_symbols: + clinic.ifndef_symbols.add(f.full_name) methoddef_ifndef = normalize_snippet(""" #ifndef {methoddef_name} #define {methoddef_name} |