diff options
Diffstat (limited to 'src/platforms/windows/windowsHandler.cpp')
| -rw-r--r-- | src/platforms/windows/windowsHandler.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/platforms/windows/windowsHandler.cpp b/src/platforms/windows/windowsHandler.cpp index b1ab87fa..6583cab1 100644 --- a/src/platforms/windows/windowsHandler.cpp +++ b/src/platforms/windows/windowsHandler.cpp @@ -79,7 +79,10 @@ const vmime::datetime windowsHandler::getCurrentLocalTime() const const time_t t(::time(NULL)); // Get the local time -#if defined(_REENTRANT) && defined(localtime_r) +#if VMIME_HAVE_LOCALTIME_S + tm local; + ::localtime_s(&local, &t); +#elif VMIME_HAVE_LOCALTIME_R tm local; ::localtime_r(&t, &local); #else @@ -87,7 +90,10 @@ const vmime::datetime windowsHandler::getCurrentLocalTime() const #endif // Get the UTC time -#if defined(_REENTRANT) && defined(gmtime_r) +#if VMIME_HAVE_GMTIME_S + tm gmt; + ::gmtime_s(&gmt, &t); +#elif VMIME_HAVE_GMTIME_R tm gmt; ::gmtime_r(&t, &gmt); #else |
