From 61b768bd593256249d3267e5bd6b6aaab805725a Mon Sep 17 00:00:00 2001 From: vlefevre Date: Thu, 18 Mar 2021 13:58:18 +0000 Subject: Get rid of obsolescent AC_HEADER_TIME. Cleanup about sys/time.h usage. The AC_HEADER_TIME macro is obsolescent in autoconf 2.69 (2012), and autoconf 2.71 (2021) outputs a warning, which makes autogen.sh fail due to "--warnings=all,error", so let's avoid the warnings. This macro defines TIME_WITH_SYS_TIME, used only in tests/tests.c (but actually not needed). We actually have two cases: 1. HAVE_GETTIMEOFDAY is defined: we use gettimeofday(), which needs . 2. Otherwise: we use time(), which needs . Based on that, we can simplify the condition in tests/tests.c for the inclusion of time-related headers, and we no longer need to check the availability. If gettimeofday() is defined but is not available (which shouldn't occur), then the current gettimeofday() usage may be incorrect anyway. Changes: * acinclude.m4: - no longer use AC_HEADER_TIME; - no longer check the sys/time.h header. * tests/tests.c: simplify the inclusion of time-related headers. git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14479 280ebfd0-de03-0410-8827-d642c229c3f4 --- tests/tests.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/tests.c') diff --git a/tests/tests.c b/tests/tests.c index 49953aba4..45d34568b 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -44,13 +44,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # include #endif -#ifdef TIME_WITH_SYS_TIME -# include /* for struct timeval */ -# include -#elif defined HAVE_SYS_TIME_H -# include +#ifdef HAVE_GETTIMEOFDAY +# include #else -# include +# include #endif /* is needed to have union fpc_csr defined under IRIX64 -- cgit v1.2.1