Skip to content

Commit b71b3d3

Browse files
committed
use StdCharBufStream in Macro
1 parent c76a3fa commit b71b3d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

simplecpp.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,7 @@ namespace simplecpp {
14811481

14821482
Macro(const std::string &name, const std::string &value, std::vector<std::string> &f) : nameTokDef(nullptr), files(f), tokenListDefine(f), valueDefinedInCode_(false) {
14831483
const std::string def(name + ' ' + value);
1484-
std::istringstream istr(def);
1485-
StdIStream stream(istr);
1484+
StdCharBufStream stream(reinterpret_cast<const unsigned char*>(def.data()), def.size());
14861485
tokenListDefine.readfile(stream);
14871486
if (!parseDefine(tokenListDefine.cfront()))
14881487
throw std::runtime_error("bad macro syntax. macroname=" + name + " value=" + value);

0 commit comments

Comments
 (0)