From c87979a7db37d6f002e1dc3ad47ce25728ed00e9 Mon Sep 17 00:00:00 2001 From: Gerhard Rieger Date: Wed, 1 Apr 2015 15:48:28 +0200 Subject: [PATCH] Corrected some configure --disable --- CHANGES | 4 ++++ compat.h | 4 +++- hostan.c | 4 ++-- xio.h | 8 +++++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 154ed14..17d853a 100644 --- a/CHANGES +++ b/CHANGES @@ -181,6 +181,10 @@ corrections: to a random port instead of terminating with error. Test: TCP4_NOPORT + configure with some combination of disable options produced config + files that failed to compile due to missing IPPROTO_TCP. + Thanks to Thierry Fournier for report and patch. + porting: Red Hat issue 1020203: configure checks fail with some compilers. Use case: clang diff --git a/compat.h b/compat.h index 6051450..6eb17a1 100644 --- a/compat.h +++ b/compat.h @@ -76,7 +76,9 @@ typedef int sig_atomic_t; /* SOL_TCP: AIX 4.3.3 */ #ifndef SOL_TCP -# define SOL_TCP IPPROTO_TCP +# ifdef IPPROTO_TCP +# define SOL_TCP IPPROTO_TCP +# endif #endif /* POSIX.1 doesn't seem to know sockets */ diff --git a/hostan.c b/hostan.c index 5391fcb..9487ef0 100644 --- a/hostan.c +++ b/hostan.c @@ -37,14 +37,14 @@ int hostan(FILE *outfile) { fprintf(outfile, "((struct diag_dgram *)0)->now-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->now)-(char *)((struct diag_dgram *)0))); fprintf(outfile, "((struct diag_dgram *)0)->exitcode-((struct diag_dgram *)0) = %u\n", (unsigned int)((char *)(&((struct diag_dgram *)0)->exitcode)-(char *)((struct diag_dgram *)0))); fprintf(outfile, "((struct diag_dgram *)0)->text-((struct diag_dgram *)0) = %u\n", (unsigned int)((((struct diag_dgram *)0)->text)-(char *)((struct diag_dgram *)0))); -#if _WITH_SOCKET +#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) fprintf(outfile, "\nIP INTERFACES\n"); iffan(outfile); #endif return 0; } -#if _WITH_SOCKET +#if _WITH_SOCKET && (_WITH_IP4 || _WITH_IP6) static int iffan(FILE *outfile) { /* Linux: man 7 netdevice */ /* FreeBSD, NetBSD: man 4 networking */ diff --git a/xio.h b/xio.h index 56caf95..187010d 100644 --- a/xio.h +++ b/xio.h @@ -1,5 +1,5 @@ /* source: xio.h */ -/* Copyright Gerhard Rieger 2001-2012 */ +/* Copyright Gerhard Rieger */ /* Published under the GNU General Public License V.2, see file COPYING */ #ifndef __xio_h_included @@ -394,10 +394,12 @@ typedef struct single { char *hosts_deny_table; #endif } ip; - struct { +#endif /* _WITH_IP4 || _WITH_IP6 */ +#if WITH_UNIX + struct { bool tight; } un; -#endif /* _WITH_IP4 || _WITH_IP6 */ +#endif /* WITH_UNIX */ } socket; #endif /* _WITH_SOCKET */ struct {