diff options
author | Peter Wu <lekensteyn@gmail.com> | 2011-12-04 13:00:17 +0000 |
---|---|---|
committer | Peter Wu <lekensteyn@gmail.com> | 2011-12-04 13:00:17 +0000 |
commit | b0fdcbbf06175cd503e5b0ecefa49759f9872dbd (patch) | |
tree | 9e8d1b39202fe17653d940a8166e62aea5a29683 /pp2cc.py | |
parent | a3e28c60b97fd96182727715ba15ed0cc713597a (diff) | |
download | pp2cc-b0fdcbbf06175cd503e5b0ecefa49759f9872dbd.tar.gz |
Add -Dmacro[=defn] and -Umacro support, remove mention of array support
Diffstat (limited to 'pp2cc.py')
-rwxr-xr-x | pp2cc.py | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1397,6 +1397,8 @@ Options: -D name -D name=definition This option is passed to the cpp program, and acts like adding #define name or #define name definition respectively + -U name This option is passed to the cpp program and acts like + adding #undef name --no-cpp Disable the use of the C Preprocessor """ try: @@ -1421,9 +1423,12 @@ Options: set_arg = "output_filename" elif arg == "--tree": settings["dump_parsed_files"] = True - elif arg == "-D": - settings["cpp_args"].append("-D") - set_arg = "cpp_args" + elif arg[1] in ("D", "U"): + settings["cpp_args"].append(arg) + if len(arg) == 2: + # Support -Dmacro=defn and -D macro=defn and + # -Umacro and -U macro + set_arg = "cpp_args" elif arg == "--no-cpp": settings["use_cpp"] = False elif arg == "-h" or arg == "--help" or arg == "--usage": |