X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c8d3a25c0981020e1b8aa3bf96a4a0059be82431..350aea695f9ad367e066bf073da2a0bb1d9a56bd:/m4/sys_time_h.m4 diff --git a/m4/sys_time_h.m4 b/m4/sys_time_h.m4 index 26eaf8ea7f..5c79300f8e 100644 --- a/m4/sys_time_h.m4 +++ b/m4/sys_time_h.m4 @@ -1,7 +1,7 @@ # Configure a replacement for . # serial 8 -# Copyright (C) 2007, 2009-2012 Free Software Foundation, Inc. +# Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -52,7 +52,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], dnl (in and for mingw64, in only dnl for MSVC) with a tv_sec field of type 'long' (32-bit!), which is dnl smaller than the 'time_t' type mandated by POSIX. - AC_CACHE_CHECK([for correct struct timeval.tv_sec member], + dnl On OpenBSD 5.1 amd64, tv_sec is 64 bits and time_t 32 bits, but + dnl that is good enough. + AC_CACHE_CHECK([for wide-enough struct timeval.tv_sec member], [gl_cv_sys_struct_timeval_tv_sec], [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -65,7 +67,9 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY], #endif ]], [[static struct timeval x; - typedef int verify_tv_sec_type[sizeof (x.tv_sec) == sizeof (time_t) ? 1 : -1]; + typedef int verify_tv_sec_type[ + sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1 + ]; ]])], [gl_cv_sys_struct_timeval_tv_sec=yes], [gl_cv_sys_struct_timeval_tv_sec=no])