Skip to content

Commit

Permalink
use StdCharBufStream in Macro
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Mar 29, 2024
1 parent 1696577 commit 1cb98c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,8 +1483,7 @@ namespace simplecpp {

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

0 comments on commit 1cb98c8

Please sign in to comment.