diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-03-18 13:58:18 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2021-03-18 13:58:18 +0000 |
commit | 61b768bd593256249d3267e5bd6b6aaab805725a (patch) | |
tree | 76acf12a4b310fb54f77f79f12b87660d5888ba8 /tests/tests.c | |
parent | a1aa835c46212c3ed4ed2626af11b5e59f1adb32 (diff) | |
download | mpfr-61b768bd593256249d3267e5bd6b6aaab805725a.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.
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14479 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tests.c')
-rw-r--r-- | tests/tests.c | 9 |
1 files changed, 3 insertions, 6 deletions
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 <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 |