mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01: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:
@ -378,10 +378,10 @@ auto Mpris::update() -> void {
|
||||
break;
|
||||
}
|
||||
auto label_format =
|
||||
fmt::format(formatstr, fmt::arg("player", info.name), fmt::arg("status", info.status_string),
|
||||
fmt::arg("artist", *info.artist), fmt::arg("title", *info.title),
|
||||
fmt::arg("album", *info.album), fmt::arg("length", *info.length),
|
||||
fmt::arg("dynamic", dynamic.str()),
|
||||
fmt::format(fmt::runtime(formatstr), fmt::arg("player", info.name),
|
||||
fmt::arg("status", info.status_string), fmt::arg("artist", *info.artist),
|
||||
fmt::arg("title", *info.title), fmt::arg("album", *info.album),
|
||||
fmt::arg("length", *info.length), fmt::arg("dynamic", dynamic.str()),
|
||||
fmt::arg("player_icon", getIcon(config_["player-icons"], info.name)),
|
||||
fmt::arg("status_icon", getIcon(config_["status-icons"], info.status_string)));
|
||||
label_.set_markup(label_format);
|
||||
|
Reference in New Issue
Block a user