diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QUtil.cc | 4 | ||||
-rw-r--r-- | libqpdf/qpdf/qpdf-config.h.in | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index c5dfa74c..39d21ea0 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -844,7 +844,11 @@ QUtil::get_current_qpdf_time() struct tm ltime; time_t now = time(0); tzset(); +#ifdef HAVE_LOCALTIME_R localtime_r(&now, <ime); +#else + ltime = *localtime(&now); +#endif return QPDFTime(static_cast<int>(ltime.tm_year + 1900), static_cast<int>(ltime.tm_mon + 1), static_cast<int>(ltime.tm_mday), diff --git a/libqpdf/qpdf/qpdf-config.h.in b/libqpdf/qpdf/qpdf-config.h.in index bee4cc49..78ebc86d 100644 --- a/libqpdf/qpdf/qpdf-config.h.in +++ b/libqpdf/qpdf/qpdf-config.h.in @@ -21,6 +21,9 @@ /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `localtime_r' function. */ +#undef HAVE_LOCALTIME_R + /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H |