diff options
author | 2020-05-09 14:15:08 -0700 | |
---|---|---|
committer | 2020-05-10 20:47:54 +0200 | |
commit | bf43fff5d6958442416597309f17dfdb081a3fc9 (patch) | |
tree | 2f8fa5adc118f16205abb1e7f011fbe89b220b28 /src/lib/netlist/plib/ppreprocessor.cpp | |
parent | c4381db330b46434b271beca8dbbdae4824dcae6 (diff) |
netlist: Added undef support to the preprocessor. [Aaron Giles]
Diffstat (limited to 'src/lib/netlist/plib/ppreprocessor.cpp')
-rw-r--r-- | src/lib/netlist/plib/ppreprocessor.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp index d6126b68fea..44ad423c8b7 100644 --- a/src/lib/netlist/plib/ppreprocessor.cpp +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -587,6 +587,19 @@ namespace plib { } } } + else if (lti[0] == "#undef") + { + if (m_if_flag == 0) + { + if (lti.size() < 2) + error("undef needs at least one argument"); + auto args(simple_iter<ppreprocessor>(this, tokenize(lt.substr(7), m_expr_sep, false, false))); + pstring n = args.next(); + if (!is_valid_token(n)) + error("undef expected identifier"); + m_defines.erase(n); + } + } else { if (m_if_flag == 0) |