From 57cc869fac939a09651f50a1702206bb8585ab86 Mon Sep 17 00:00:00 2001 From: Daniel Richman Date: Fri, 24 Aug 2012 02:21:14 +0100 Subject: [PATCH] Get localtime_r and gmtime_r on mingw32 --- src/RFC3339.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RFC3339.cxx b/src/RFC3339.cxx index 5a1f066..e96714e 100644 --- a/src/RFC3339.cxx +++ b/src/RFC3339.cxx @@ -11,6 +11,14 @@ #include #include +/* on mingw32, localtime_r and gmtime_r don't exist. Instead, pthreadsw32's + * pthread.h provides macros that map calls from localtime_r to localtime(), + * (and the same for gmtime), noting that "[the] WIN32 C runtime library has + * been made thread-safe without affecting the user interface." + * + * tl;dr: need to include pthread.h to get localtime_r on mingw32 */ +#include + using namespace std; namespace RFC3339 {