From: Alon Bar-Lev Date: Sat, 12 May 2012 22:19:49 +0300 Message-Id: <1336850389-23719-17-git-send-email-alon.barlev@...277...> In-Reply-To: <1336850389-23719-1-git-send-email-alon.barlev@...277...> References: <1336850389-23719-1-git-send-email-alon.barlev@...277...> Subject: [Openvpn-devel] [PATCH 16/16] clenaup: syshead: reworder/cleanup includes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net, openvpn.list@...1114..., openvpn-devel@lists.sourceforge.net, openvpn.list@...1114... Cc: Alon Bar-Lev Signed-off-by: Alon Bar-Lev --- configure.ac | 2 +- src/openvpn/syshead.h | 146 ++++++++++++------------------------------------- 2 files changed, 36 insertions(+), 112 deletions(-) diff --git a/configure.ac b/configure.ac index cca9508..97eb5f0 100644 --- a/configure.ac +++ b/configure.ac @@ -643,7 +643,7 @@ old_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${TAP_CFLAGS}" AC_CHECK_HEADERS( [ \ - net/if_tun.h net/tun/if_tun.h \ + net/if_tun.h net/tun/if_tun.h net/if_tap.h \ linux/if_tun.h \ tap-windows.h \ ], diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index d5a9af1..1b9cbe0 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -31,6 +31,10 @@ #ifdef WIN32 #include #include +#include +#include +#include +#include #endif #ifdef HAVE_SYS_TYPES_H @@ -135,18 +139,6 @@ #include #endif -#ifdef HAVE_NETDB_H -#include -#endif - -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#ifdef HAVE_RESOLV_H -#include -#endif - #ifdef HAVE_SYS_POLL_H #include #endif @@ -155,6 +147,10 @@ #include #endif +#ifdef HAVE_SYS_MMAN_H +#include +#endif + #ifdef ENABLE_SELINUX #include #endif @@ -163,29 +159,47 @@ #include #endif -#ifdef TARGET_SOLARIS #ifdef HAVE_STRINGS_H #include #endif -#else + #ifdef HAVE_STRING_H #include #endif + +#ifdef HAVE_STROPTS_H +#include +#endif + +#ifdef HAVE_NETDB_H +#include #endif #ifdef HAVE_ARPA_INET_H #include #endif +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_NETINET_IP_H +#include +#endif + +#ifdef HAVE_NETINET_TCP_H +#include +#endif + #ifdef HAVE_NET_IF_H #include #endif -#ifdef TARGET_NETBSD -#include +#ifdef HAVE_RESOLV_H +#include #endif -#ifdef TARGET_LINUX +#if defined(TARGET_LINUX) #if defined(HAVE_NETINET_IF_ETHER_H) #include @@ -195,10 +209,6 @@ #include #endif -#ifdef HAVE_NETINET_IP_H -#include -#endif - #ifdef HAVE_LINUX_SOCKIOS_H #include #endif @@ -211,17 +221,7 @@ #include #endif -#ifdef HAVE_NETINET_TCP_H -#include -#endif - -#endif /* TARGET_LINUX */ - -#ifdef TARGET_SOLARIS - -#ifdef HAVE_STROPTS_H -#include -#endif +#elif defined(TARGET_SOLARIS) #ifdef HAVE_NET_IF_TUN_H #include @@ -231,41 +231,7 @@ #include #endif -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif - -#ifdef HAVE_NETINET_IP_H -#include -#endif - -#ifdef HAVE_NETINET_TCP_H -#include -#endif - -#endif /* TARGET_SOLARIS */ - -#ifdef TARGET_OPENBSD - -#ifdef HAVE_SYS_UIO_H -#include -#endif - -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif - -#ifdef HAVE_NETINET_IP_H -#include -#endif - -#ifdef HAVE_NET_IF_TUN_H -#include -#endif - -#endif /* TARGET_OPENBSD */ - -#ifdef TARGET_FREEBSD +#elif defined(TARGET_OPENBSD) || defined(TARGET_FREEBSD) || defined(TARGET_NETBSD) || defined(TARGET_DRAGONFLY) #ifdef HAVE_SYS_UIO_H #include @@ -275,60 +241,18 @@ #include #endif -#ifdef HAVE_NETINET_IP_H -#include -#endif - #ifdef HAVE_NET_IF_TUN_H #include #endif -#endif /* TARGET_FREEBSD */ - -#ifdef TARGET_NETBSD - -#ifdef HAVE_NET_IF_TUN_H -#include -#endif - -#ifdef HAVE_NETINET_TCP_H -#include -#endif - -#endif /* TARGET_NETBSD */ - -#ifdef TARGET_DRAGONFLY - -#ifdef HAVE_SYS_UIO_H -#include -#endif - -#ifdef HAVE_NETINET_IN_SYSTM_H -#include -#endif - -#ifdef HAVE_NETINET_IP_H -#include -#endif - #ifdef HAVE_NET_TUN_IF_TUN_H #include #endif -#endif /* TARGET_DRAGONFLY */ - -#ifdef WIN32 -#include -#include -#include -#include -/* The following two headers are needed of PF_INET6 */ -#include -#include +#ifdef HAVE_NET_IF_TAP_H +#include #endif -#ifdef HAVE_SYS_MMAN_H -#include #endif /* -- 1.7.3.4