From 53f7f27693dc5b3ac606a1ca3a7225467e15e162 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sat, 22 Jun 2019 17:26:07 +0200 Subject: FreeBSD cleanups to header shuffling. --- configure.ac | 21 ++++----------------- fetchmail.h | 7 ------- socket.c | 5 +---- uid_db.c | 7 +++---- uid_db.h | 4 ++++ 5 files changed, 12 insertions(+), 32 deletions(-) diff --git a/configure.ac b/configure.ac index 2b210db0..b39c70b3 100644 --- a/configure.ac +++ b/configure.ac @@ -78,18 +78,12 @@ AC_CHECK_HEADERS([unistd.h termios.h termio.h sgtty.h stdarg.h \ if test _$ac_cv_header_stdarg_h != _yes ; then AC_MSG_WARN([stdarg.h is not defined. Unsupported configuration, proceed at your own risk.]) fi -AC_CHECK_TYPE(u_int32_t,, - AC_DEFINE(u_int32_t,unsigned int, - [Define to unsigned int if does not define.]), - [AC_INCLUDES_DEFAULT -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif]) + +AC_TYPE_UINT32_T + AC_CHECK_HEADERS([resolv.h],,,[ #include -#ifdef HAVE_NETINET_IN_H #include -#endif #ifdef HAVE_ARPA_NAMESER_H #include #endif @@ -191,12 +185,8 @@ dnl INET6 is used by KAME/getnameinfo AC_CACHE_CHECK(for AF_INET6/PF_INET6,ac_cv_inet6, AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ - #ifdef HAVE_SYS_TYPES_H #include - #endif - #ifdef HAVE_SYS_SOCKET_H #include - #endif ]],[[ int foo = AF_INET6; int bar = PF_INET6; @@ -222,9 +212,7 @@ for lib in '' -lresolv; do LIBS="$old_LIBS $lib" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -#ifdef HAVE_NETINET_IN_H #include -#endif #ifdef HAVE_ARPA_NAMESER_H #include #endif @@ -273,9 +261,8 @@ pid = waitpid (-1, &status, 0); AC_MSG_CHECKING(sys_siglist declaration in signal.h or unistd.h) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include /* NetBSD declares sys_siglist in . */ -#ifdef HAVE_UNISTD_H #include -#endif]], [[char *msg = *(sys_siglist + 1);]])],[AC_DEFINE(SYS_SIGLIST_DECLARED,1,[Define if 'sys_siglist' is declared by .]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) +]], [[char *msg = *(sys_siglist + 1);]])],[AC_DEFINE(SYS_SIGLIST_DECLARED,1,[Define if 'sys_siglist' is declared by .]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]) # Find the right directory to put the root-mode PID file in for dir in "/var/run" "/etc" diff --git a/fetchmail.h b/fetchmail.h index 6a224cae..8e546693 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -5,7 +5,6 @@ * For license terms, see the file COPYING in this directory. */ -/* We need this for HAVE_STDARG_H, etc */ #include "config.h" struct addrinfo; @@ -40,12 +39,6 @@ struct addrinfo; #endif #include "uid_db.h" - -/* We need this for strstr */ -#if !defined(HAVE_STRSTR) && !defined(strstr) -char *strstr(const char *, const char *); -#endif - #include "fm_strl.h" /* constants designating the various supported protocols */ diff --git a/socket.c b/socket.c index 399ba189..123000ed 100644 --- a/socket.c +++ b/socket.c @@ -15,11 +15,7 @@ #endif /* HAVE_MEMORY_H */ #include #include -#ifndef HAVE_NET_SOCKET_H #include -#else -#include -#endif #include #include #ifdef HAVE_ARPA_INET_H @@ -53,6 +49,7 @@ #include "getaddrinfo.h" #include "i18n.h" #include "sdump.h" +#include "uid_db.h" /* Defines to allow BeOS and Cygwin to play nice... */ #ifdef __BEOS__ diff --git a/uid_db.c b/uid_db.c index fdc35b73..ef36efbe 100644 --- a/uid_db.c +++ b/uid_db.c @@ -8,9 +8,7 @@ 6.3.17 release, including the OpenSSL exemption. */ -/* Have Solaris expose ffs() from strings.h: */ -#define __EXTENSIONS__ -#define _XOPEN_SOURCE 700 +#include "fetchmail.h" /* includes */ #include @@ -18,9 +16,10 @@ #include #include /* ffs() lives here - needs #define on Solaris. */ -#include "xmalloc.h" #include "uid_db.h" +#include "xmalloc.h" + /* constants */ enum { MIN_RECORDS = 16 /* arbitrary */ diff --git a/uid_db.h b/uid_db.h index f76f740f..b24dea03 100644 --- a/uid_db.h +++ b/uid_db.h @@ -10,6 +10,10 @@ #ifndef fetchmail_uid_db_h #define fetchmail_uid_db_h +/* If ffs() is missing on, for instance, Solaris, make sure that config.h or fetchmail.h + * contains #define __EXTENSIONS__ - autoconf should set it in config.h. */ +#include "config.h" + /* includes */ #include -- cgit v1.2.3