diff options
author | 2020-05-06 22:43:32 +0200 | |
---|---|---|
committer | 2020-05-06 22:43:32 +0200 | |
commit | 53ac38cf359dddc0937cc534e5150db60c0a110f (patch) | |
tree | caa1c5ac7a5a95f2964e9234858e0e36d0566d12 /src/lib/netlist/plib/ppreprocessor.cpp | |
parent | 2dbdd730b1a789c62178ded66c173181592f51c7 (diff) |
netlist: add elif processing to preprocessor. [Couriersud]
Diffstat (limited to 'src/lib/netlist/plib/ppreprocessor.cpp')
-rw-r--r-- | src/lib/netlist/plib/ppreprocessor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp index 089188f3106..d6126b68fea 100644 --- a/src/lib/netlist/plib/ppreprocessor.cpp +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -484,6 +484,18 @@ namespace plib { { m_if_flag ^= (1 << m_if_level); } + else if (lti[0] == "#elif") + { + m_if_flag ^= (1 << m_if_level); + lt = replace_macros(lt); + auto t(simple_iter<ppreprocessor>(this, tokenize(lt.substr(5), m_expr_sep, true, true))); + auto val = static_cast<int>(prepro_expr(t, 255)); + t.skip_ws(); + if (!t.eod()) + error("found unprocessed content at end of line"); + if (val == 0) + m_if_flag |= (1 << m_if_level); + } else if (lti[0] == "#endif") { m_if_flag &= ~(1 << m_if_level); |