From b709a4d858537060a96f2b6986d15d3abcb9529a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 31 Dec 2024 11:13:01 +0100 Subject: Don't check for TIME_WITH_SYS_TIME Follow the suggestion made by the autoupdate(1) tool: | All current systems provide time.h; it need not be checked for. Not | all systems provide sys/time.h, but those that do, all allow you to | include it and time.h simultaneously. Therefore, include sys/time.h if available, and include time.h unconditionally. --- configure.ac | 15 +-------------- plugins/common.h | 10 ++-------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/configure.ac b/configure.ac index e3b66fef..79b44c7b 100644 --- a/configure.ac +++ b/configure.ac @@ -607,23 +607,10 @@ dnl dnl Checks for header files. dnl -m4_warn([obsolete], -[Update your code to rely only on HAVE_SYS_TIME_H, -then remove this warning and the obsolete code below it. -All current systems provide time.h; it need not be checked for. -Not all systems provide sys/time.h, but those that do, all allow -you to include it and time.h simultaneously.])dnl -AC_CHECK_HEADERS_ONCE([sys/time.h]) -# Obsolete code to be removed. -if test $ac_cv_header_sys_time_h = yes; then - AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both - and . This macro is obsolete.]) -fi -# End of obsolete code. - AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(signal.h syslog.h uio.h errno.h sys/time.h sys/socket.h sys/un.h sys/poll.h) AC_CHECK_HEADERS(features.h stdarg.h sys/unistd.h ctype.h) +AC_CHECK_HEADERS_ONCE([sys/time.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/plugins/common.h b/plugins/common.h index 833479ce..b7a7d59b 100644 --- a/plugins/common.h +++ b/plugins/common.h @@ -90,16 +90,10 @@ # define GET_NUMBER_OF_CPUS() -1 #endif -#ifdef TIME_WITH_SYS_TIME +#ifdef HAVE_SYS_TIME_H # include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif +#include #ifdef HAVE_SYS_TYPES_H #include -- cgit v1.2.3-74-g34f1