Mercurial > gnulib
changeset 37145:78d25e6288df
sys_time: port to OpenBSD
* lib/sys_time.in.h: Simply delegate to the system's header
in the BSDish cases as well. Problem reported by Mike Miller in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00016.html>.
* tests/test-sys_select.c, tests/test-sys_time.c (verify_tv_sec_type):
Allow platforms like 64-bit OpenBSD where timeval's tv_sec is
wider than time_t.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 10 Aug 2013 22:02:58 -0700 |
parents | 21563c422b39 |
children | 55441ff7d9d8 |
files | ChangeLog lib/sys_time.in.h tests/test-sys_select.c tests/test-sys_time.c |
diffstat | 4 files changed, 19 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Sat Aug 10 07:10:55 2013 -0700 +++ b/ChangeLog Sat Aug 10 22:02:58 2013 -0700 @@ -1,3 +1,13 @@ +2013-08-10 Paul Eggert <eggert@cs.ucla.edu> + + sys_time: port to OpenBSD + * lib/sys_time.in.h: Simply delegate to the system's header + in the BSDish cases as well. Problem reported by Mike Miller in + <http://lists.gnu.org/archive/html/bug-gnulib/2013-08/msg00016.html>. + * tests/test-sys_select.c, tests/test-sys_time.c (verify_tv_sec_type): + Allow platforms like 64-bit OpenBSD where timeval's tv_sec is + wider than time_t. + 2013-08-09 Pádraig Brady <P@draigBrady.com> bootstrap: support checksum utils having -c but not --status
--- a/lib/sys_time.in.h Sat Aug 10 07:10:55 2013 -0700 +++ b/lib/sys_time.in.h Sat Aug 10 22:02:58 2013 -0700 @@ -24,11 +24,12 @@ #endif @PRAGMA_COLUMNS@ -/* On Cygwin, <sys/time.h> includes itself recursively via <sys/select.h>. +/* On Cygwin and on many BSDish systems, <sys/time.h> includes itself + recursively via <sys/select.h>. Simply delegate to the system's header in this case; it is a no-op. Without this extra ifdef, the C++ gettimeofday declaration below would be a forward declaration in gnulib's nested <sys/time.h>. */ -#ifdef _CYGWIN_SYS_TIME_H +#if defined _CYGWIN_SYS_TIME_H || defined _SYS_TIME_H || defined _SYS_TIME_H_ # @INCLUDE_NEXT@ @NEXT_SYS_TIME_H@ #else
--- a/tests/test-sys_select.c Sat Aug 10 07:10:55 2013 -0700 +++ b/tests/test-sys_select.c Sat Aug 10 22:02:58 2013 -0700 @@ -40,8 +40,9 @@ /* Check that the 'struct timeval' type is defined. */ struct timeval a; -/* Check that &a.tv_sec is a 'time_t *', ignoring signedness issues. */ -typedef int verify_tv_sec_type[sizeof (a.tv_sec) == sizeof (time_t) ? 1 : -1]; +/* Check that a.tv_sec is wide enough to hold a time_t, ignoring + signedness issues. */ +typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1]; /* Check that sigset_t is defined. */ sigset_t t2;
--- a/tests/test-sys_time.c Sat Aug 10 07:10:55 2013 -0700 +++ b/tests/test-sys_time.c Sat Aug 10 22:02:58 2013 -0700 @@ -23,8 +23,9 @@ /* Check that the 'struct timeval' type is defined. */ struct timeval a; -/* Check that &a.tv_sec is a 'time_t *', ignoring signedness issues. */ -typedef int verify_tv_sec_type[sizeof (a.tv_sec) == sizeof (time_t) ? 1 : -1]; +/* Check that a.tv_sec is wide enough to hold a time_t, ignoring + signedness issues. */ +typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1]; int main (void)