summaryrefslogtreecommitdiff
path: root/pp2cc.py
diff options
context:
space:
mode:
Diffstat (limited to 'pp2cc.py')
-rwxr-xr-xpp2cc.py11
1 files changed, 8 insertions, 3 deletions
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":