diff options
Diffstat (limited to 'src/platforms')
| -rw-r--r-- | src/platforms/posix/posixHandler.cpp | 4 | ||||
| -rw-r--r-- | src/platforms/windows/windowsHandler.cpp | 10 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/platforms/posix/posixHandler.cpp b/src/platforms/posix/posixHandler.cpp index d90b316c..6536b5ef 100644 --- a/src/platforms/posix/posixHandler.cpp +++ b/src/platforms/posix/posixHandler.cpp @@ -132,7 +132,7 @@ const vmime::datetime posixHandler::getCurrentLocalTime() const const time_t t(::time(NULL)); // Get the local time -#ifdef _REENTRANT +#if VMIME_HAVE_LOCALTIME_R tm local; ::localtime_r(&t, &local); #else @@ -140,7 +140,7 @@ const vmime::datetime posixHandler::getCurrentLocalTime() const #endif // Get the UTC time -#ifdef _REENTRANT +#if VMIME_HAVE_GMTIME_R tm gmt; ::gmtime_r(&t, &gmt); #else 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 |
