From 366d0f1106e59ac68b4516a6c66aab7065ea0d12 Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Mon, 3 Mar 2014 16:13:46 -0800 Subject: [PATCH] timeval: localtime_r, gmtime_r for Windows. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- lib/timeval.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/timeval.h b/lib/timeval.h index c207f23ad..0bd74ccde 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -40,6 +40,11 @@ BUILD_ASSERT_DECL(TYPE_IS_SIGNED(time_t)); #define TIME_MAX TYPE_MAXIMUM(time_t) #define TIME_MIN TYPE_MINIMUM(time_t) +#ifdef _WIN32 +#define localtime_r(timep, result) localtime_s(result, timep) +#define gmtime_r(timep, result) gmtime_s(result, timep) +#endif /* _WIN32 */ + struct tm_msec { struct tm tm; int msec; -- 2.20.1