diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -179,8 +179,11 @@ optparse(char **args) } } else if (*arg == 'g') { /* TODO debug info */ - } else if (*arg == 'D') { - /* TODO cmdline defines */ + } else if (*arg == 'D' || *arg == 'U') { + void cpppredef(bool undef, const char *cmd); + const char *def = arg[1] ? arg+1 : *++args; + if (!def) fatal(NULL, "macro name missing after `-%c`", *arg); + cpppredef(*arg == 'U', def); } else if (*arg == 'O') { /* TODO optimization level */ } else if (*arg == 'I') { |