From b71b3d3065ad0835aaaead14fa7a34d912f893e6 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 29 Mar 2024 19:15:28 +0100 Subject: [PATCH] use `StdCharBufStream` in `Macro` --- simplecpp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index c1460cf..a9adfdd 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -1481,8 +1481,7 @@ namespace simplecpp { Macro(const std::string &name, const std::string &value, std::vector &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(def.data()), def.size()); tokenListDefine.readfile(stream); if (!parseDefine(tokenListDefine.cfront())) throw std::runtime_error("bad macro syntax. macroname=" + name + " value=" + value);