diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-12-26 13:30:57 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2022-04-14 18:37:03 -0400 |
commit | 906aec0df58c9b0fb411edca1934e7263e5d339f (patch) | |
tree | 3e3782a714a1e40c8f032647b2f067b62c559d8c | |
parent | 20ac070fca245a45aca5b2905a7c6eed14eafd62 (diff) | |
download | meson-906aec0df58c9b0fb411edca1934e7263e5d339f.zip meson-906aec0df58c9b0fb411edca1934e7263e5d339f.tar.gz meson-906aec0df58c9b0fb411edca1934e7263e5d339f.tar.bz2 |
ac_converter: use better style for header check iteration
underscorifying and upper casing the header name is superior to
duplicating it.
-rwxr-xr-x | tools/ac_converter.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/ac_converter.py b/tools/ac_converter.py index c3b954c..f2a5599 100755 --- a/tools/ac_converter.py +++ b/tools/ac_converter.py @@ -382,7 +382,7 @@ with open(sys.argv[1], encoding='utf-8') as f: tarr = token.split('_')[1:-1] tarr = [x.lower() for x in tarr] hname = '/'.join(tarr) + '.h' - headers.append((token, hname)) + headers.append(hname) # Check for functions. try: @@ -413,13 +413,13 @@ cdata = configuration_data()''') # Convert header checks. print('check_headers = [') -for token, hname in headers: - print(f" ['{token}', '{hname}'],") +for hname in headers: + print(f" '{hname}',") print(']\n') print('''foreach h : check_headers - if cc.has_header(h.get(1)) - cdata.set(h.get(0), 1) + if cc.has_header(h) + cdata.set('HAVE_' + h.underscorify().to_upper(), 1) endif endforeach ''') |