From 1cb98c854f24dbe08131c90617074a8d3bdf8ed1 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 6152164..3b0a077 100755 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -1483,8 +1483,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);