summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/time.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/time.c b/src/time.c
index f236b2a77..cf2fd3b91 100644
--- a/src/time.c
+++ b/src/time.c
@@ -26,8 +26,9 @@
/* #define NO_GMTIME_R */
#ifdef _WIN32
-/* unfortunately Win32 platform do not provide gmtime_r/localtime_r */
-#define NO_GMTIME_R
+/* Win32 platform do not provide gmtime_r/localtime_r; emulate them using gmtime_s/localtime_s */
+#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tp) : NULL)
+#define localtime_r(tp, tm) ((localtime_s((tm), (tp)) == 0) ? (tp) : NULL)
#endif
/* timegm(3) */