blob: 105738670ccbbe045dd6ea4621f373ee4eeaed4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
https://github.com/djcb/mu/commit/0a4fabbf446d15b538600dfe7d879cad70ce941e
From 0a4fabbf446d15b538600dfe7d879cad70ce941e Mon Sep 17 00:00:00 2001
From: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
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 <typename T=::time_t>
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<std::string>;
|