From fc8541ad2db0afd207ad180191622538e6c09204 Mon Sep 17 00:00:00 2001 From: Timerix Date: Sat, 15 Nov 2025 14:41:58 +0500 Subject: [PATCH] fixed portable_localtime_s on posix systems --- src/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/time.c b/src/time.c index a3423ed..6fe6b39 100644 --- a/src/time.c +++ b/src/time.c @@ -45,8 +45,8 @@ void sleepMsec(msec_t time){ sleepNsec(time * M); } -#define portable_localtime_s(time_t_ptr, tm_ptr) IFWIN(localtime_s(tm_ptr, time_t_ptr), localtime_s(time_t_ptr, tm_ptr)) -#define portable_gmtime_s(time_t_ptr, tm_ptr) IFWIN(gmtime_s(tm_ptr, time_t_ptr), gmtime_s(time_t_ptr, tm_ptr)) +#define portable_localtime_s(time_t_ptr, tm_ptr) IFWIN(localtime_s(tm_ptr, time_t_ptr), localtime_r(time_t_ptr, tm_ptr)) +#define portable_gmtime_s(time_t_ptr, tm_ptr) IFWIN(gmtime_s(tm_ptr, time_t_ptr), gmtime_r(time_t_ptr, tm_ptr)) void DateTime_get(DateTime* dt, bool utc_time){ time_t c_time = time(NULL);