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:
@ -213,14 +213,14 @@ auto Gamemode::update() -> void {
|
||||
|
||||
// Tooltip
|
||||
if (tooltip) {
|
||||
std::string text = fmt::format(tooltip_format, fmt::arg("count", gameCount));
|
||||
std::string text = fmt::format(fmt::runtime(tooltip_format), fmt::arg("count", gameCount));
|
||||
box_.set_tooltip_text(text);
|
||||
}
|
||||
|
||||
// Label format
|
||||
std::string str =
|
||||
fmt::format(showAltText ? format_alt : format, fmt::arg("glyph", useIcon ? "" : glyph),
|
||||
fmt::arg("count", gameCount > 0 ? std::to_string(gameCount) : ""));
|
||||
std::string str = fmt::format(fmt::runtime(showAltText ? format_alt : format),
|
||||
fmt::arg("glyph", useIcon ? "" : glyph),
|
||||
fmt::arg("count", gameCount > 0 ? std::to_string(gameCount) : ""));
|
||||
label_.set_markup(str);
|
||||
|
||||
if (useIcon) {
|
||||
|
Reference in New Issue
Block a user