aboutsummaryrefslogtreecommitdiffstats
path: root/src/dateTime.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-02-05 13:21:21 +0000
committerVincent Richard <[email protected]>2013-02-05 13:21:21 +0000
commitc2474f2b2b581ddfd207095b4ee433757e2abfbf (patch)
treeff7350316f0da2ba53ab50bd356187763aa8eda3 /src/dateTime.cpp
parentUpdated book. Added build target for HTML using HeVeA. (diff)
downloadvmime-c2474f2b2b581ddfd207095b4ee433757e2abfbf.tar.gz
vmime-c2474f2b2b581ddfd207095b4ee433757e2abfbf.zip
Check for localtime_r and gmtime_r at build instead of testing _REENTRANT. Use localtime_s and gmtime_s on Windows, if available.
Diffstat (limited to 'src/dateTime.cpp')
-rw-r--r--src/dateTime.cpp5
1 files changed, 3 insertions, 2 deletions
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 <iomanip>
+#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;