timeval: localtime_r, gmtime_r for Windows.
authorGurucharan Shetty <gshetty@nicira.com>
Tue, 4 Mar 2014 00:13:46 +0000 (16:13 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Tue, 4 Mar 2014 23:22:15 +0000 (15:22 -0800)
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/timeval.h

index c207f23..0bd74cc 100644 (file)
@@ -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;