[ovs-dev] [PATCH] timeval: localtime_r, gmtime_r for Windows.

Gurucharan Shetty shettyg at nicira.com
Tue Mar 4 22:33:50 UTC 2014


Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 lib/timeval.h |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/timeval.h b/lib/timeval.h
index c207f23..f745855 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -40,6 +40,13 @@ 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;
-- 
1.7.9.5




More information about the dev mailing list