Skip to content

Commit 0f763fe

Browse files
committed
Patch up for the libfmt change and update to c++20.Patch up for the
libfmt change and update to c++20.
1 parent f5adb89 commit 0f763fe

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export BUILDTYPE
1111
ifeq ($(BUILDTYPE),windows)
1212
MINGW = i686-w64-mingw32-
1313
CC = $(MINGW)gcc
14-
CXX = $(MINGW)g++ -std=c++17
14+
CXX = $(MINGW)g++ -std=c++20
1515
CFLAGS += -g -O3
1616
CXXFLAGS += \
1717
-fext-numeric-literals \

lib/core/globals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ struct ErrorException
4848
template <typename... Args>
4949
[[noreturn]] inline void error(fmt::string_view fstr, const Args&... args)
5050
{
51-
throw ErrorException{fmt::format(fstr, args...)};
51+
throw ErrorException{fmt::format(fmt::runtime(fstr), args...)};
5252
}
5353

5454
extern void warning(const std::string msg);
5555

5656
template <typename... Args>
5757
inline void warning(fmt::string_view fstr, const Args&... args)
5858
{
59-
warning(fmt::format(fstr, args...));
59+
warning(fmt::format(fmt::runtime(fstr), args...));
6060
}
6161

6262
template <class... Ts>

lib/core/logger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ inline void log(const T& message)
9292
template <typename... Args>
9393
inline void log(fmt::string_view fstr, const Args&... args)
9494
{
95-
log(fmt::format(fstr, args...));
95+
log(fmt::format(fmt::runtime(fstr), args...));
9696
}
9797

9898
class LogRenderer

lib/usb/applesauceusb.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ class ApplesauceUsb : public USB
111111
std::string sendrecv(const std::string& command)
112112
{
113113
if (_config.verbose())
114-
fmt::print(fmt::format("> {}\n", command));
114+
fmt::print("> {}\n", command);
115115
_serial->writeLine(command);
116116
auto r = _serial->readLine();
117117
if (_config.verbose())
118-
fmt::print(fmt::format("< {}\n", r));
118+
fmt::print("< {}\n", r);
119119
return r;
120120
}
121121

@@ -136,7 +136,7 @@ class ApplesauceUsb : public USB
136136
doCommand(command);
137137
std::string r = _serial->readLine();
138138
if (_config.verbose())
139-
fmt::print(fmt::format("<< {}\n", r));
139+
fmt::print("<< {}\n", r);
140140
return r;
141141
}
142142

src/fe-analysedriveresponse.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void draw_y_axis(Agg2D& painter,
167167
[&](double y, double v)
168168
{
169169
painter.line(x, y, x - 5, y);
170-
painter.text(x - 8, y + 5.0, fmt::format(format, v));
170+
painter.text(x - 8, y + 5.0, fmt::format(fmt::runtime(format), v));
171171
});
172172
}
173173

@@ -194,7 +194,7 @@ static void draw_x_axis(Agg2D& painter,
194194
[&](double x, double v)
195195
{
196196
painter.line(x, y, x, y + 5);
197-
painter.text(x, y + 18, fmt::format(format, v));
197+
painter.text(x, y + 18, fmt::format(fmt::runtime(format), v));
198198
});
199199
}
200200

tests/configs.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bool failed = false;
1111
template <typename... Args>
1212
static void configError(fmt::string_view format_str, const Args&... args)
1313
{
14-
fmt::print(stderr, format_str, args...);
14+
fmt::print(stderr, fmt::runtime(format_str), args...);
1515
fputc('\n', stderr);
1616
failed = true;
1717
}

0 commit comments

Comments
 (0)