[lttng-dev] [Babeltrace RFC PATCH 12/28] Add MinGW implementation of localtime_r

Ikaheimonen, JP jp_ikaheimonen at mentor.com
Thu May 2 07:53:39 EDT 2013


---
 include/babeltrace/compat/time.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/babeltrace/compat/time.h b/include/babeltrace/compat/time.h
index ccfc860..d5cb7fd 100644
--- a/include/babeltrace/compat/time.h
+++ b/include/babeltrace/compat/time.h
@@ -15,5 +15,13 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result)
 	return result;
 }
 
+static inline
+struct tm *localtime_r(const time_t *timep, struct tm *result)
+{
+	struct tm * r;
+	r = localtime(timep);
+	memcpy(result, r, sizeof (struct tm));
+	return result;
+}
 #endif
 #endif
-- 
1.8.1.msysgit.1




More information about the lttng-dev mailing list