Skip to content

Commit 4768d12

Browse files
committed
use StdCharBufStream in Macro
1 parent ff37d02 commit 4768d12

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

simplecpp.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1490,8 +1490,7 @@ namespace simplecpp {
14901490

14911491
Macro(const std::string &name, const std::string &value, std::vector<std::string> &f) : nameTokDef(nullptr), files(f), tokenListDefine(f), valueDefinedInCode_(false) {
14921492
const std::string def(name + ' ' + value);
1493-
std::istringstream istr(def);
1494-
StdIStream stream(istr);
1493+
StdCharBufStream stream(reinterpret_cast<const unsigned char*>(def.data()), def.size());
14951494
tokenListDefine.readfile(stream);
14961495
if (!parseDefine(tokenListDefine.cfront()))
14971496
throw std::runtime_error("bad macro syntax. macroname=" + name + " value=" + value);

0 commit comments

Comments
 (0)