mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-14 23:22:31 +02:00
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode: - `fmt::format` defaults to compile-time argument checking and requires using `fmt::runtime(format_string)` to bypass that. - `std::format` implementation introduces conflicting declarations and we have to specify the namespace for all `format`/`format_to` calls.
This commit is contained in:
@ -127,16 +127,16 @@ auto User::update() -> void {
|
||||
auto startSystemTime = currentSystemTime - workSystemTimeSeconds;
|
||||
long workSystemDays = uptimeSeconds / 86400;
|
||||
|
||||
auto label = fmt::format(ALabel::format_, fmt::arg("up_H", fmt::format("{:%H}", startSystemTime)),
|
||||
fmt::arg("up_M", fmt::format("{:%M}", startSystemTime)),
|
||||
fmt::arg("up_d", fmt::format("{:%d}", startSystemTime)),
|
||||
fmt::arg("up_m", fmt::format("{:%m}", startSystemTime)),
|
||||
fmt::arg("up_Y", fmt::format("{:%Y}", startSystemTime)),
|
||||
fmt::arg("work_d", workSystemDays),
|
||||
fmt::arg("work_H", fmt::format("{:%H}", workSystemTimeSeconds)),
|
||||
fmt::arg("work_M", fmt::format("{:%M}", workSystemTimeSeconds)),
|
||||
fmt::arg("work_S", fmt::format("{:%S}", workSystemTimeSeconds)),
|
||||
fmt::arg("user", systemUser));
|
||||
auto label = fmt::format(
|
||||
fmt::runtime(ALabel::format_), fmt::arg("up_H", fmt::format("{:%H}", startSystemTime)),
|
||||
fmt::arg("up_M", fmt::format("{:%M}", startSystemTime)),
|
||||
fmt::arg("up_d", fmt::format("{:%d}", startSystemTime)),
|
||||
fmt::arg("up_m", fmt::format("{:%m}", startSystemTime)),
|
||||
fmt::arg("up_Y", fmt::format("{:%Y}", startSystemTime)), fmt::arg("work_d", workSystemDays),
|
||||
fmt::arg("work_H", fmt::format("{:%H}", workSystemTimeSeconds)),
|
||||
fmt::arg("work_M", fmt::format("{:%M}", workSystemTimeSeconds)),
|
||||
fmt::arg("work_S", fmt::format("{:%S}", workSystemTimeSeconds)),
|
||||
fmt::arg("user", systemUser));
|
||||
ALabel::label_.set_markup(label);
|
||||
AIconLabel::update();
|
||||
}
|
||||
|
Reference in New Issue
Block a user