From: Amos Jeffries Date: Fri, 27 Sep 2013 16:06:15 +0000 (-0600) Subject: Portability: cleanup includes for sys/time.h and sys/resource.h X-Git-Tag: SQUID_3_5_0_1~632 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3310172592f65cc00463fc8d96f002b9374b46f4;p=thirdparty%2Fsquid.git Portability: cleanup includes for sys/time.h and sys/resource.h These two include files are order-dependent on several operating systems and as such are provided by Squid libcompat headers. There is no need for code to include them specially and several HAVE_SYS_TIME_H macros were missing which breaks the build on systems where the file is missing. --- diff --git a/compat/os/mswindows.h b/compat/os/mswindows.h index 95edff63e5..99c97f5bcf 100644 --- a/compat/os/mswindows.h +++ b/compat/os/mswindows.h @@ -802,6 +802,10 @@ WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f) #define open _open /* Needed in win32lib.c */ #endif /* #ifdef __cplusplus */ +/* provide missing definitions from resoruce.h */ +/* NP: sys/resource.h and sys/time.h are apparently order-dependant. */ +#if HAVE_SYS_TIME_H +#endif #if HAVE_SYS_RESOURCE_H #include #else diff --git a/helpers/basic_auth/MSNT/msntauth.cc b/helpers/basic_auth/MSNT/msntauth.cc index b6b844d742..49adc2bf39 100644 --- a/helpers/basic_auth/MSNT/msntauth.cc +++ b/helpers/basic_auth/MSNT/msntauth.cc @@ -37,7 +37,6 @@ #include #include #include -#include #include "msntauth.h" diff --git a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc index 30394da729..28d97ee372 100644 --- a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc +++ b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc @@ -89,10 +89,6 @@ PFldap_start_tls_s Win32_ldap_start_tls_s; #endif -#if defined(LDAP_OPT_NETWORK_TIMEOUT) -#include -#endif - #define PROGRAM_NAME "ext_ldap_group_acl" #define PROGRAM_VERSION "2.17" diff --git a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc index 7be404e772..0d1d2dd2cc 100644 --- a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc +++ b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc @@ -46,9 +46,6 @@ #if HAVE_TIME_H #include #endif -#if HAVE_SYS_TIME_H -#include -#endif #if HAVE_ERRNO_H #include #endif diff --git a/src/mgr/CountersAction.h b/src/mgr/CountersAction.h index e4d9013707..b8cbcba208 100644 --- a/src/mgr/CountersAction.h +++ b/src/mgr/CountersAction.h @@ -7,7 +7,6 @@ #define SQUID_MGR_COUNTERS_ACTION_H #include "mgr/Action.h" -#include namespace Mgr { diff --git a/src/mgr/InfoAction.h b/src/mgr/InfoAction.h index e48e94c546..f5cdc6097b 100644 --- a/src/mgr/InfoAction.h +++ b/src/mgr/InfoAction.h @@ -8,7 +8,6 @@ #include "mgr/Action.h" #include "StoreStats.h" -#include namespace Mgr { diff --git a/src/mgr/IntervalAction.h b/src/mgr/IntervalAction.h index 95e0771c94..68c207eb3d 100644 --- a/src/mgr/IntervalAction.h +++ b/src/mgr/IntervalAction.h @@ -7,7 +7,6 @@ #define SQUID_MGR_INTERVAL_ACTION_H #include "mgr/Action.h" -#include namespace Mgr { diff --git a/src/win32.h b/src/win32.h index b32c8c5bf9..022011aeca 100644 --- a/src/win32.h +++ b/src/win32.h @@ -35,13 +35,6 @@ #if _SQUID_WINDOWS_ -#if HAVE_SYS_TIME_H -#include -#endif -#if HAVE_SYS_RESOURCE_H -#include -#endif - void WIN32_ExceptionHandlerInit(void); int Win32__WSAFDIsSet(int fd, fd_set* set);