From d78ad40aaf95070d5d9f9ccde9f348a9af10faba Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 20 Mar 2019 17:51:48 -0700 Subject: [PATCH] feat(script/gen_constants_cpp.py): support for provifing custom C name --- script/gen_constants_cpp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/gen_constants_cpp.py b/script/gen_constants_cpp.py index bd1e296a10..bb8152d7c8 100755 --- a/script/gen_constants_cpp.py +++ b/script/gen_constants_cpp.py @@ -47,7 +47,11 @@ def main(argv=None): constants = [] with open(infile, 'r') as f: for line in f: - constants.append([to_c_const(line.strip()), line.strip()]) + p = line.split() + if len(p) == 2: + constants.append([p[1].strip(), p[0].strip()]) + else: + constants.append([to_c_const(line.strip()), line.strip()]) basedir, name = os.path.split(infile) os.chdir(basedir)