4831981d89
Distcc removes comments, making the comment silencing
not work.
I know there was a decision against a macro in commit
ec251fe7d5
25 lines
453 B
Python
Executable file
25 lines
453 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
"""Generate %-from-name.gperf from %-list.txt
|
|
"""
|
|
|
|
import sys
|
|
|
|
name, prefix, input = sys.argv[1:]
|
|
|
|
print("""\
|
|
%{
|
|
#if __GNUC__ >= 7
|
|
_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
|
|
#endif
|
|
%}""")
|
|
print("""\
|
|
struct {}_name {{ const char* name; int id; }};
|
|
%null-strings
|
|
%%""".format(name))
|
|
|
|
for line in open(input):
|
|
line = line.rstrip()
|
|
s = line.replace('_', '-')
|
|
print("{}, {}{}".format(s, prefix, line))
|