Get localtime_r and gmtime_r on mingw32

pull/1/merge
Daniel Richman 2012-08-24 02:21:14 +01:00
rodzic 280da5c603
commit 57cc869fac
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -11,6 +11,14 @@
#include <stdexcept>
#include <iomanip>
/* 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 <pthread.h>
using namespace std;
namespace RFC3339 {