diff options
author | 2019-10-28 13:44:26 +0100 | |
---|---|---|
committer | 2019-10-28 13:44:26 +0100 | |
commit | 97129cece5642e2821a06534e9d407b2be1e405d (patch) | |
tree | b5fefe9c1defc31568ebfe53036ff7de13f613c8 /src/lib/netlist/plib/pstream.h | |
parent | 88aaa3cafa694368832ee98aa7c07ff983ae3b3e (diff) |
netlist: Preprocessor enhancements. [Couriersud]
The builtin preprocessor now behaves closer to cpp:
- supports macro parameters, i.e. define x(a) a
- supports stringification, i.e. define x(a) #a
- supports concatenation, i.e. define x(a) a ## _ext
In addition, error reporting now provides a source context including the
include history.
Diffstat (limited to 'src/lib/netlist/plib/pstream.h')
-rw-r--r-- | src/lib/netlist/plib/pstream.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index 77d4c82b87f..13903caa9b4 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -84,6 +84,8 @@ public: if (m_strm->eof()) return false; m_strm->read(&b, 1); + if (m_strm->eof()) + return false; return true; } @@ -93,12 +95,14 @@ public: if (m_strm->eof()) return false; m_strm->read(&b[0], 1); + if (m_strm->eof()) + return false; const std::size_t l = putf8string::traits_type::codelen(reinterpret_cast<putf8string::traits_type::mem_t *>(&b)); for (std::size_t i = 1; i < l; i++) { + m_strm->read(&b[i], 1); if (m_strm->eof()) return false; - m_strm->read(&b[i], 1); } c = putf8string::traits_type::code(reinterpret_cast<putf8string::traits_type::mem_t *>(&b)); return true; |