diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2021-01-08 23:48:43 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-01-18 15:32:46 +0000 |
commit | bd1adcffe7f3e51f490bf57889e7454816661196 (patch) | |
tree | 48e1c1399db4152c6168c26edc6104004ac2f49d /src/helper/system.h | |
parent | 8b7569c2196ea69e72d5daf5c7294d98feb20268 (diff) | |
download | riscv-openocd-bd1adcffe7f3e51f490bf57889e7454816661196.zip riscv-openocd-bd1adcffe7f3e51f490bf57889e7454816661196.tar.gz riscv-openocd-bd1adcffe7f3e51f490bf57889e7454816661196.tar.bz2 |
configure: drop macro 'AC_HEADER_TIME'
The macro AC_HEADER_TIME has been obsoleted by autoconf 2.70.
Not all systems provide 'sys/time.h', plus some old system didn't
allowed to include both 'time.h' and 'sys/time.h' because 'time.h'
was included by 'sys/time.h' and was not properly protected to
allow multiple inclusion.
The macro AC_HEADER_TIME helps to detect such odd case.
Nowadays all the systems properly protect 'time.h', so its safe to
unconditionally include 'time.h', even if it is also included by
'sys/time.h'.
The case of systems without 'sys/time.h' is already covered by
configure.ac through the directive
AC_CHECK_HEADERS([sys/time.h])
Remove the obsoleted autoconf macro and simplify the code by
including 'time.h' unconditionally and check HAVE_SYS_TIME_H to
include 'sys/time.h'.
Change-Id: Iddb3f3f1d90c22668b97f8e756e1b4f733367a7d
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6010
Tested-by: jenkins
Reviewed-by: Marc Schink <dev@zapb.de>
Diffstat (limited to 'src/helper/system.h')
-rw-r--r-- | src/helper/system.h | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/helper/system.h b/src/helper/system.h index 97b3443..1aaca3b 100644 --- a/src/helper/system.h +++ b/src/helper/system.h @@ -28,19 +28,11 @@ #include <assert.h> #include <ctype.h> #include <errno.h> +#include <time.h> -/* +++ AC_HEADER_TIME +++ */ -#ifdef TIME_WITH_SYS_TIME -# include <sys/time.h> -# include <time.h> -#else -# ifdef HAVE_SYS_TIME_H -# include <sys/time.h> -# else -# include <time.h> -# endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> #endif -/* --- AC_HEADER_TIME --- */ /* +++ platform specific headers +++ */ #ifdef _WIN32 |