From c2474f2b2b581ddfd207095b4ee433757e2abfbf Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Tue, 5 Feb 2013 14:21:21 +0100 Subject: Check for localtime_r and gmtime_r at build instead of testing _REENTRANT. Use localtime_s and gmtime_s on Windows, if available. --- src/dateTime.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dateTime.cpp') diff --git a/src/dateTime.cpp b/src/dateTime.cpp index feb18718..f98d7c64 100644 --- a/src/dateTime.cpp +++ b/src/dateTime.cpp @@ -23,6 +23,7 @@ #include +#include "vmime/config.hpp" #include "vmime/dateTime.hpp" #include "vmime/platform.hpp" #include "vmime/parserHelpers.hpp" @@ -663,7 +664,7 @@ datetime::datetime(const time_t t, const int zone) tms = *gtm; else if (ltm) tms = *ltm; -#elif defined(_REENTRANT) +#elif VMIME_HAVE_LOCALTIME_R struct tm tms; if (!gmtime_r(&t, &tms)) @@ -678,7 +679,7 @@ datetime::datetime(const time_t t, const int zone) tms = *gtm; else if (ltm) tms = *ltm; -#endif // _REENTRANT +#endif m_year = tms.tm_year + 1900; m_month = tms.tm_mon + 1; -- cgit v1.2.3