diff options
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": |