diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-09-07 07:17:01 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-09-07 07:17:01 +0000 |
commit | 8a127af3dc24b663a40d18af558cc5ec7032cf9b (patch) | |
tree | faaebe4668adb7072e3ff982f240ac51eafe1261 | |
parent | ba7976039a73e6d87d4ecf0930fb1497f3e0deb1 (diff) | |
download | mpfr-8a127af3dc24b663a40d18af558cc5ec7032cf9b.tar.gz |
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 <sys/time.h>.
2. Otherwise: we use time(), which needs <time.h>.
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 <sys/time.h> availability. If gettimeofday() is defined
but <sys/time.h> 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.
(merged changeset r14479 from the trunk)
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/branches/4.1@14571 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | acinclude.m4 | 3 | ||||
-rw-r--r-- | tests/tests.c | 9 |
2 files changed, 4 insertions, 8 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index b8462ea59..32f235214 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -40,7 +40,6 @@ AC_DEFUN([MPFR_CONFIGS], AC_REQUIRE([AC_OBJEXT]) AC_REQUIRE([MPFR_CHECK_LIBM]) AC_REQUIRE([MPFR_CHECK_LIBQUADMATH]) -AC_REQUIRE([AC_HEADER_TIME]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl Features for the MPFR shared cache. This needs to be done @@ -119,7 +118,7 @@ AC_CHECK_HEADER([stdarg.h],[AC_DEFINE([HAVE_STDARG],1,[Define if stdarg])], AC_MSG_ERROR([stdarg.h or varargs.h not found]))]) dnl sys/fpu.h - MIPS specific -AC_CHECK_HEADERS([sys/time.h sys/fpu.h]) +AC_CHECK_HEADERS([sys/fpu.h]) dnl Android has a <locale.h>, but not the following members. AC_CHECK_MEMBERS([struct lconv.decimal_point, struct lconv.thousands_sep],,, diff --git a/tests/tests.c b/tests/tests.c index 95f58b318..87360d35a 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -37,13 +37,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # include <fenv.h> #endif -#ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> /* for struct timeval */ -# include <time.h> -#elif defined HAVE_SYS_TIME_H -# include <sys/time.h> +#ifdef HAVE_GETTIMEOFDAY +# include <sys/time.h> #else -# include <time.h> +# include <time.h> #endif /* <sys/fpu.h> is needed to have union fpc_csr defined under IRIX64 |