]> granicus.if.org Git - libevent/commitdiff
test: fix 32bit linux regress
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Fri, 1 Sep 2017 22:50:36 +0000 (15:50 -0700)
committerAzat Khuzhin <azat@libevent.org>
Sat, 2 Feb 2019 12:13:53 +0000 (15:13 +0300)
(cherry picked from commit 63c4bf78d6af3c6ff46d2e8e4b53dd9f577a9ca9)

CMakeLists.txt
WIN32-Code/nmake/event2/event-config.h
configure.ac
test/regress_util.c

index 638a537cef524464c519a8175904779af90aae61..ee07541f93ac4efdf311b4a7ea14275977b91026 100644 (file)
@@ -458,7 +458,6 @@ else()
     set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT})
 endif()
 
-
 CHECK_TYPE_SIZE(socklen_t EVENT__SIZEOF_SOCKLEN_T)
 if(NOT EVENT__SIZEOF_SOCKLEN_T)
   set(EVENT__socklen_t "unsigned int")
@@ -490,6 +489,7 @@ endif()
 # we're just getting lazy now.
 CHECK_TYPE_SIZE("uintptr_t" EVENT__HAVE_UINTPTR_T)
 CHECK_TYPE_SIZE("void *" EVENT__SIZEOF_VOID_P)
+CHECK_TYPE_SIZE("time_t" EVENT__SIZEOF_TIME_T)
 
 # Tests file offset bits.
 # TODO: Add AIX test for if -D_LARGE_FILES is needed.
index a3664aa2467398378a709d08d6cd172b4777a98b..c09ec3f9dd83549c03e1f968c3bbf4471ba1ac20 100644 (file)
 #define EVENT__SIZEOF_VOID_P 4
 #endif
 
+/* The size of `time_t`, as computed by sizeof. */
+#ifdef _WIN64
+#define EVENT__SIZEOF_TIME_T 8
+#else
+#define EVENT__SIZEOF_TIME_T 4
+#endif
+
 /* Define to 1 if you have the ANSI C header files. */
 #define EVENT__STDC_HEADERS 1
 
index 05ef57a7690dabfecf200b1ca9f1361d0dea6c23..4c7f1f6e9d6e65285cf52183ca1b7923fe025185 100644 (file)
@@ -658,6 +658,7 @@ AC_CHECK_SIZEOF(short)
 AC_CHECK_SIZEOF(size_t)
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(time_t)
 
 AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t, struct addrinfo, struct sockaddr_storage], , ,
 [#define _GNU_SOURCE
index ef6a1487aae2a88ff6ae1d15b5d5b5a3980d2e39..68281e6153f5315b1d4517cb38c2cc4d71e479d2 100644 (file)
@@ -1412,10 +1412,12 @@ static struct date_rfc1123_case {
        {  1289433600, "Thu, 11 Nov 2010 00:00:00 GMT"},
        {  1323648000, "Mon, 12 Dec 2011 00:00:00 GMT"},
 #ifndef _WIN32
+#if EVENT__SIZEOF_TIME_T > 4
        /** In win32 case we have max   "23:59:59 January 18, 2038, UTC" for time32 */
        {  4294967296, "Sun, 07 Feb 2106 06:28:16 GMT"} /* 2^32 */,
        /** In win32 case we have max "23:59:59, December 31, 3000, UTC" for time64 */
        {253402300799, "Fri, 31 Dec 9999 23:59:59 GMT"} /* long long future no one can imagine */,
+#endif /* time_t != 32bit */
        {  1456704000, "Mon, 29 Feb 2016 00:00:00 GMT"} /* leap year */,
 #endif
        {  1435708800, "Wed, 01 Jul 2015 00:00:00 GMT"} /* leap second */,