From 82d606979b0fe8c59f029f0494276943c47b96ae Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Thu, 17 Mar 2016 21:39:17 +1100 Subject: [PATCH] Add HAVE_*_H checks around inclusions of netinet/in.h and sys/socket.h Only include and if the system supplies them. This is necessary to try and get the mingw32 build working again. No need to include and from cdns.c - these are already included by . --- include/irc.h | 5 +++++ include/irc_std.h | 2 ++ include/struct.h | 2 ++ source/cdns.c | 3 --- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/irc.h b/include/irc.h index 2f67cfb..3673e95 100644 --- a/include/irc.h +++ b/include/irc.h @@ -60,8 +60,13 @@ extern char thing_star[4]; # include #endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif + +#ifdef HAVE_NETINET_IN_H #include +#endif #ifdef HAVE_ARPA_INET_H #include diff --git a/include/irc_std.h b/include/irc_std.h index 85fa07e..b189c5b 100644 --- a/include/irc_std.h +++ b/include/irc_std.h @@ -37,7 +37,9 @@ /* * Everybody needs these INET headers... */ +#ifdef HAVE_NETINET_IN_H #include +#endif #ifdef HAVE_ARPA_INET_H #include #endif diff --git a/include/struct.h b/include/struct.h index a7bf8c7..1847b66 100644 --- a/include/struct.h +++ b/include/struct.h @@ -19,7 +19,9 @@ #include "hash.h" #include "config.h" #include "ssl.h" +#ifdef HAVE_NETINET_IN_H #include +#endif /* * struct sockaddr_storage isn't avaiable on all ipv6-ready-systems, bleh ;( diff --git a/source/cdns.c b/source/cdns.c index d7d7105..1da6e7c 100644 --- a/source/cdns.c +++ b/source/cdns.c @@ -21,9 +21,6 @@ * $Id$ */ -#include -#include - #include "cdns.h" #include "irc.h" /* To pick up our next #define checks */ static char cvsrevision[] = "$Id$";