From 51bd766ba654251ac31ec1ee0e4440866dd8aa8a Mon Sep 17 00:00:00 2001 From: zimoch Date: Tue, 24 Jun 2014 13:20:19 +0000 Subject: [PATCH] Fix or rather workaround for MinGW and maybe other systems without localtime_r function --- src/TimestampConverter.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/TimestampConverter.cc b/src/TimestampConverter.cc index 970b4ed..48f8bd7 100644 --- a/src/TimestampConverter.cc +++ b/src/TimestampConverter.cc @@ -64,6 +64,13 @@ int timezone = 0; } while (0) #endif +#if defined(__MINGW32__) +/* MinGW has no re-entrant localtime. How about other environments? */ +/* Just let's hope for the best */ +#undef localtime_r +#define localtime_r(timet,tm) (*(tm)=*localtime(timet)) +#endif + class TimestampConverter : public StreamFormatConverter { int parse(const StreamFormat&, StreamBuffer&, const char*&, bool);