diff --git a/Makefile b/Makefile index 2a2560f8..02e7886a 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ export BUILDTYPE ifeq ($(BUILDTYPE),windows) MINGW = i686-w64-mingw32- CC = $(MINGW)gcc - CXX = $(MINGW)g++ -std=c++17 + CXX = $(MINGW)g++ -std=c++20 CFLAGS += -g -O3 CXXFLAGS += \ -fext-numeric-literals \ diff --git a/lib/core/globals.h b/lib/core/globals.h index b249aac6..4ca57eb2 100644 --- a/lib/core/globals.h +++ b/lib/core/globals.h @@ -48,7 +48,7 @@ struct ErrorException template [[noreturn]] inline void error(fmt::string_view fstr, const Args&... args) { - throw ErrorException{fmt::format(fstr, args...)}; + throw ErrorException{fmt::format(fmt::runtime(fstr), args...)}; } extern void warning(const std::string msg); @@ -56,7 +56,7 @@ extern void warning(const std::string msg); template inline void warning(fmt::string_view fstr, const Args&... args) { - warning(fmt::format(fstr, args...)); + warning(fmt::format(fmt::runtime(fstr), args...)); } template diff --git a/lib/core/logger.h b/lib/core/logger.h index cd25f7cf..89abe823 100644 --- a/lib/core/logger.h +++ b/lib/core/logger.h @@ -92,7 +92,7 @@ inline void log(const T& message) template inline void log(fmt::string_view fstr, const Args&... args) { - log(fmt::format(fstr, args...)); + log(fmt::format(fmt::runtime(fstr), args...)); } class LogRenderer diff --git a/lib/usb/applesauceusb.cc b/lib/usb/applesauceusb.cc index fd27b2bc..edb1b9a4 100644 --- a/lib/usb/applesauceusb.cc +++ b/lib/usb/applesauceusb.cc @@ -111,11 +111,11 @@ private: std::string sendrecv(const std::string& command) { if (_config.verbose()) - fmt::print(fmt::format("> {}\n", command)); + fmt::print("> {}\n", command); _serial->writeLine(command); auto r = _serial->readLine(); if (_config.verbose()) - fmt::print(fmt::format("< {}\n", r)); + fmt::print("< {}\n", r); return r; } @@ -136,7 +136,7 @@ private: doCommand(command); std::string r = _serial->readLine(); if (_config.verbose()) - fmt::print(fmt::format("<< {}\n", r)); + fmt::print("<< {}\n", r); return r; } diff --git a/src/fe-analysedriveresponse.cc b/src/fe-analysedriveresponse.cc index 52bfc14e..8ec163fa 100644 --- a/src/fe-analysedriveresponse.cc +++ b/src/fe-analysedriveresponse.cc @@ -167,7 +167,7 @@ static void draw_y_axis(Agg2D& painter, [&](double y, double v) { painter.line(x, y, x - 5, y); - painter.text(x - 8, y + 5.0, fmt::format(format, v)); + painter.text(x - 8, y + 5.0, fmt::format(fmt::runtime(format), v)); }); } @@ -194,7 +194,7 @@ static void draw_x_axis(Agg2D& painter, [&](double x, double v) { painter.line(x, y, x, y + 5); - painter.text(x, y + 18, fmt::format(format, v)); + painter.text(x, y + 18, fmt::format(fmt::runtime(format), v)); }); } diff --git a/tests/configs.cc b/tests/configs.cc index 90b8b141..d95d0103 100644 --- a/tests/configs.cc +++ b/tests/configs.cc @@ -11,7 +11,7 @@ bool failed = false; template static void configError(fmt::string_view format_str, const Args&... args) { - fmt::print(stderr, format_str, args...); + fmt::print(stderr, fmt::runtime(format_str), args...); fputc('\n', stderr); failed = true; }