From b0fdcbbf06175cd503e5b0ecefa49759f9872dbd Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Sun, 4 Dec 2011 13:00:17 +0000 Subject: Add -Dmacro[=defn] and -Umacro support, remove mention of array support --- pp2cc.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pp2cc.py') diff --git a/pp2cc.py b/pp2cc.py index 27c0fa1..99585c4 100755 --- a/pp2cc.py +++ b/pp2cc.py @@ -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": -- cgit v1.2.1