mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 15:17:29 +00:00
Add autoconf test for localtime_r
This commit is contained in:
parent
2538d84413
commit
df067c9ab6
@ -1,6 +1,6 @@
|
|||||||
715dae6d625977752bf7ddf7e386a2dc6ada04b8e56c6f0e7a3f7dcc9bad3209 configure.ac
|
cabe87703520d63bbb0ea3e069c3488fd8b43667ae29c2ee5bffffaf20321002 configure.ac
|
||||||
d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4
|
d3f9ee6f6f0846888d9a10fd3dad2e4b1258be84205426cf04d7cef02d61dad7 aclocal.m4
|
||||||
d12e9b7b928e7b2b9d4ffbc2af170392421376e60e40d07bdeee6a7252be8f6e libqpdf/qpdf/qpdf-config.h.in
|
3ed561073f0d5c9899e2120e006a7da5ec6bffb80268da1b962cd4f893b89982 libqpdf/qpdf/qpdf-config.h.in
|
||||||
5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4
|
5297971a0ef90bcd5563eb3f7127a032bb76d3ae2af7258bf13479caf8983a60 m4/ax_cxx_compile_stdcxx.m4
|
||||||
35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
|
35bc5c645dc42d47f2daeea06f8f3e767c8a1aee6a35eb2b4854fd2ce66c3413 m4/ax_random_device.m4
|
||||||
1451e63710701b5f00a668f3a79b435015ef2e63547f0ad0ce8c8c062d53b599 m4/libtool.m4
|
1451e63710701b5f00a668f3a79b435015ef2e63547f0ad0ce8c8c062d53b599 m4/libtool.m4
|
||||||
|
21
configure
vendored
21
configure
vendored
@ -17474,24 +17474,13 @@ $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for ac_func in fseeko64
|
for ac_func in fseeko64 random localtime_r
|
||||||
do :
|
do :
|
||||||
ac_fn_c_check_func "$LINENO" "fseeko64" "ac_cv_func_fseeko64"
|
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
if test "x$ac_cv_func_fseeko64" = xyes; then :
|
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||||
|
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
#define HAVE_FSEEKO64 1
|
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||||
_ACEOF
|
|
||||||
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in random
|
|
||||||
do :
|
|
||||||
ac_fn_c_check_func "$LINENO" "random" "ac_cv_func_random"
|
|
||||||
if test "x$ac_cv_func_random" = xyes; then :
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
|
||||||
#define HAVE_RANDOM 1
|
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
@ -310,9 +310,7 @@ AC_ARG_WITH(large-file-test-path,
|
|||||||
|
|
||||||
AC_SYS_LARGEFILE
|
AC_SYS_LARGEFILE
|
||||||
AC_FUNC_FSEEKO
|
AC_FUNC_FSEEKO
|
||||||
AC_CHECK_FUNCS([fseeko64])
|
AC_CHECK_FUNCS([fseeko64 random localtime_r])
|
||||||
|
|
||||||
AC_CHECK_FUNCS(random)
|
|
||||||
|
|
||||||
# Check if LD supports linker scripts, and define conditional
|
# Check if LD supports linker scripts, and define conditional
|
||||||
# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently
|
# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently
|
||||||
|
@ -844,7 +844,11 @@ QUtil::get_current_qpdf_time()
|
|||||||
struct tm ltime;
|
struct tm ltime;
|
||||||
time_t now = time(0);
|
time_t now = time(0);
|
||||||
tzset();
|
tzset();
|
||||||
|
#ifdef HAVE_LOCALTIME_R
|
||||||
localtime_r(&now, <ime);
|
localtime_r(&now, <ime);
|
||||||
|
#else
|
||||||
|
ltime = *localtime(&now);
|
||||||
|
#endif
|
||||||
return QPDFTime(static_cast<int>(ltime.tm_year + 1900),
|
return QPDFTime(static_cast<int>(ltime.tm_year + 1900),
|
||||||
static_cast<int>(ltime.tm_mon + 1),
|
static_cast<int>(ltime.tm_mon + 1),
|
||||||
static_cast<int>(ltime.tm_mday),
|
static_cast<int>(ltime.tm_mday),
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#undef HAVE_INTTYPES_H
|
#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. */
|
/* Define to 1 if you have the <memory.h> header file. */
|
||||||
#undef HAVE_MEMORY_H
|
#undef HAVE_MEMORY_H
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user