Skip to content

Commit 1cb98c8

Browse files
committed
use StdCharBufStream in Macro
1 parent 1696577 commit 1cb98c8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

simplecpp.cpp

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

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

0 commit comments

Comments
 (0)