summaryrefslogtreecommitdiff
path: root/pp2cc.py
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2011-12-04 13:00:17 +0000
committerPeter Wu <lekensteyn@gmail.com>2011-12-04 13:00:17 +0000
commitb0fdcbbf06175cd503e5b0ecefa49759f9872dbd (patch)
tree9e8d1b39202fe17653d940a8166e62aea5a29683 /pp2cc.py
parenta3e28c60b97fd96182727715ba15ed0cc713597a (diff)
downloadpp2cc-b0fdcbbf06175cd503e5b0ecefa49759f9872dbd.tar.gz
Add -Dmacro[=defn] and -Umacro support, remove mention of array support
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":