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:
@ -336,8 +336,8 @@ auto UPower::update() -> void {
|
||||
break;
|
||||
}
|
||||
std::string label_format =
|
||||
fmt::format(showAltText ? format_alt : format, fmt::arg("percentage", percentString),
|
||||
fmt::arg("time", time_format));
|
||||
fmt::format(fmt::runtime(showAltText ? format_alt : format),
|
||||
fmt::arg("percentage", percentString), fmt::arg("time", time_format));
|
||||
// Only set the label text if it doesn't only contain spaces
|
||||
bool onlySpaces = true;
|
||||
for (auto& character : label_format) {
|
||||
|
Reference in New Issue
Block a user