Patch up for the libfmt change and update to c++20.Patch up for the

libfmt change and update to c++20.
This commit is contained in:
David Given
2025-03-12 01:22:18 +01:00
parent f5adb89338
commit 0f763fe06b
6 changed files with 10 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ export BUILDTYPE
ifeq ($(BUILDTYPE),windows) ifeq ($(BUILDTYPE),windows)
MINGW = i686-w64-mingw32- MINGW = i686-w64-mingw32-
CC = $(MINGW)gcc CC = $(MINGW)gcc
CXX = $(MINGW)g++ -std=c++17 CXX = $(MINGW)g++ -std=c++20
CFLAGS += -g -O3 CFLAGS += -g -O3
CXXFLAGS += \ CXXFLAGS += \
-fext-numeric-literals \ -fext-numeric-literals \

View File

@@ -48,7 +48,7 @@ struct ErrorException
template <typename... Args> template <typename... Args>
[[noreturn]] inline void error(fmt::string_view fstr, const Args&... args) [[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); extern void warning(const std::string msg);
@@ -56,7 +56,7 @@ extern void warning(const std::string msg);
template <typename... Args> template <typename... Args>
inline void warning(fmt::string_view fstr, const Args&... args) inline void warning(fmt::string_view fstr, const Args&... args)
{ {
warning(fmt::format(fstr, args...)); warning(fmt::format(fmt::runtime(fstr), args...));
} }
template <class... Ts> template <class... Ts>

View File

@@ -92,7 +92,7 @@ inline void log(const T& message)
template <typename... Args> template <typename... Args>
inline void log(fmt::string_view fstr, const Args&... args) inline void log(fmt::string_view fstr, const Args&... args)
{ {
log(fmt::format(fstr, args...)); log(fmt::format(fmt::runtime(fstr), args...));
} }
class LogRenderer class LogRenderer

View File

@@ -111,11 +111,11 @@ private:
std::string sendrecv(const std::string& command) std::string sendrecv(const std::string& command)
{ {
if (_config.verbose()) if (_config.verbose())
fmt::print(fmt::format("> {}\n", command)); fmt::print("> {}\n", command);
_serial->writeLine(command); _serial->writeLine(command);
auto r = _serial->readLine(); auto r = _serial->readLine();
if (_config.verbose()) if (_config.verbose())
fmt::print(fmt::format("< {}\n", r)); fmt::print("< {}\n", r);
return r; return r;
} }
@@ -136,7 +136,7 @@ private:
doCommand(command); doCommand(command);
std::string r = _serial->readLine(); std::string r = _serial->readLine();
if (_config.verbose()) if (_config.verbose())
fmt::print(fmt::format("<< {}\n", r)); fmt::print("<< {}\n", r);
return r; return r;
} }

View File

@@ -167,7 +167,7 @@ static void draw_y_axis(Agg2D& painter,
[&](double y, double v) [&](double y, double v)
{ {
painter.line(x, y, x - 5, y); 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) [&](double x, double v)
{ {
painter.line(x, y, x, y + 5); 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));
}); });
} }

View File

@@ -11,7 +11,7 @@ bool failed = false;
template <typename... Args> template <typename... Args>
static void configError(fmt::string_view format_str, const Args&... args) 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); fputc('\n', stderr);
failed = true; failed = true;
} }