https://github.com/djcb/mu/commit/0a4fabbf446d15b538600dfe7d879cad70ce941e From 0a4fabbf446d15b538600dfe7d879cad70ce941e Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 28 Sep 2025 18:52:56 +0300 Subject: [PATCH] utils: avoid fmt:gmtime/fmt::localtime They've been deprecated and give build warnings with new enough libfmt. --- lib/utils/mu-utils.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/mu-utils.hh b/lib/utils/mu-utils.hh index ecdc2f24d..32bb0ddb7 100644 --- a/lib/utils/mu-utils.hh +++ b/lib/utils/mu-utils.hh @@ -145,7 +145,9 @@ auto mu_join(Range&& range, std::string_view sepa) { template std::tm mu_time(T t={}, bool use_utc=false) { ::time_t tt{static_cast<::time_t>(t)}; - return use_utc ? fmt::gmtime(tt) : fmt::localtime(tt); + std::tm time_tm = {}; + use_utc ? gmtime_r(&tt, &time_tm) : localtime_r(&tt, &time_tm); + return time_tm; } using StringVec = std::vector;