MSVC does not have localtime_r, so add abstraction.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7829>
#include <stdbool.h>
#include <stdint.h>
+#include <time.h>
#ifdef __cplusplus
extern "C" {
}
+static inline struct tm *
+os_localtime(const time_t *timer, struct tm *buf)
+{
+#ifdef _WIN32
+ return localtime_s(buf, timer) ? NULL : buf;
+#else
+ return localtime_r(timer, buf);
+#endif
+}
+
+
/*
* Sleep.
*/