summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2016-09-19 03:10:04 +0200
committerGravatar Nikias Bassen2016-09-19 03:10:04 +0200
commit8d34de3078469aba636846a15bad08198f66fdc8 (patch)
treedb97f8ccb45f35f28348b7e2bffc070b87297089 /configure.ac
parent912cb45928f03355ca162a2f1286ca49eb58155c (diff)
downloadlibplist-8d34de3078469aba636846a15bad08198f66fdc8.tar.gz
libplist-8d34de3078469aba636846a15bad08198f66fdc8.tar.bz2
Use time64 implementation by Michael G Schwern to extend allowed date/time range
The main benefit of this is to allow date/time values outside of the 32bit time_t range which is very important on 32bit platforms. But there are also some other issues that will be fixed with this, for example on macOS, mktime() will not work for dates < 1902 despite time_t being 64bit. In the same run this commit will also use a reentrant version of gmtime64_r that should help in multithreaded scenarios. Original code taken from: https://github.com/evalEmpire/y2038
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac28
1 files changed, 27 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 8394997..5f99d95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ AC_TYPE_UINT32_T
56AC_TYPE_UINT8_T 56AC_TYPE_UINT8_T
57 57
58# Checks for library functions. 58# Checks for library functions.
59AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf]) 59AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf gmtime_r localtime_r timegm])
60 60
61# Checking endianness 61# Checking endianness
62AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])], 62AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])],
@@ -78,6 +78,32 @@ case ${host_os} in
78esac 78esac
79AM_CONDITIONAL(WIN32, test x$win32 = xtrue) 79AM_CONDITIONAL(WIN32, test x$win32 = xtrue)
80 80
81# Check if struct tm has a tm_gmtoff member
82AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
83 AC_TRY_COMPILE([
84 #include <time.h>
85 ], [
86 struct tm tm;
87 tm.tm_gmtoff = 1;
88 ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
89
90if (test "$ac_cv_struct_tm_gmtoff" = "yes"); then
91 AC_DEFINE(HAVE_TM_TM_GMTOFF, 1, [Define if struct tm has a tm_gmtoff member])
92fi
93
94# Check if struct tm has a tm_zone member
95AC_CACHE_CHECK(for tm_zone in struct tm, ac_cv_struct_tm_zone,
96 AC_TRY_COMPILE([
97 #include <time.h>
98 ], [
99 struct tm tm;
100 tm.tm_zone = 1;
101 ], ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no))
102
103if (test "$ac_cv_struct_tm_zone" = "yes"); then
104 AC_DEFINE(HAVE_TM_TM_ZONE, 1, [Define if struct tm has a tm_zone member])
105fi
106
81# Cython Python Bindings 107# Cython Python Bindings
82AC_ARG_WITH([cython], 108AC_ARG_WITH([cython],
83 [AS_HELP_STRING([--without-cython], 109 [AS_HELP_STRING([--without-cython],