From: Amos Jeffries Date: Fri, 21 Feb 2014 10:46:19 +0000 (-0700) Subject: Cleanup: un-wrap C++ header includes X-Git-Tag: SQUID_3_5_0_1~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=074d6a40c66faa228e8863e791655f9502028501;p=thirdparty%2Fsquid.git Cleanup: un-wrap C++ header includes Coding guideline is now that standard C++ headers are not to be wrapped in HAVE_ macros. * Remove HAVE_ macros for currently wrapped C++ headers. Includes removing autoconf checks. * Replace C includes with C++ includes where possible Also, / has issues on 64-bit systems and a portable fixed version is provided by libcompat via squid.h It should not be included anywhere in the Squid sources. --- diff --git a/compat/compat_shared.h b/compat/compat_shared.h index a24043b310..39b16cf976 100644 --- a/compat/compat_shared.h +++ b/compat/compat_shared.h @@ -171,9 +171,13 @@ max(A const & lhs, A const & rhs) * Signalling flags are apparently not always provided. * TODO find out if these can be moved into specific OS portability files. */ +#if defined(__cplusplus) +#include +#else #if HAVE_SIGNAL_H #include #endif +#endif #ifndef SA_RESTART #define SA_RESTART 0 #endif diff --git a/compat/mswindows.cc b/compat/mswindows.cc index 3d9833394c..d9359b595d 100644 --- a/compat/mswindows.cc +++ b/compat/mswindows.cc @@ -41,10 +41,9 @@ #define sys_nerr _sys_nerr #undef assert -#include -#include +#include +#include #include -#include #include #if HAVE_WIN32_PSAPI #include diff --git a/compat/stdio.h b/compat/stdio.h index a474d21f55..c111cc762c 100644 --- a/compat/stdio.h +++ b/compat/stdio.h @@ -15,7 +15,7 @@ // Import the stdio.h definitions first to do the state setup #if HAVE_STDIO_H -#include +#include #endif // Check for the buggy case @@ -46,7 +46,7 @@ inline FILE * tmpfile(void) { return tmpfile64(); } #endif /* __USE_FILE_OFFSET64 && !__REDIRECT */ // Finally import the stuff we actually use -#if HAVE_CSTDIO && defined(__cplusplus) +#if defined(__cplusplus) #include #endif diff --git a/compat/stdvarargs.h b/compat/stdvarargs.h index dc8f6c182b..c890c74d3f 100644 --- a/compat/stdvarargs.h +++ b/compat/stdvarargs.h @@ -6,7 +6,7 @@ * We provide a clean set of wrappers for the various operations * Depending on what is available and needed. */ -#if HAVE_CSTDARG && defined(__cplusplus) +#if defined(__cplusplus) #include #else @@ -18,7 +18,7 @@ #define VA_SHIFT(v,t) ; /* no-op for ANSI */ #define VA_END va_end(ap) -#else +#else /* !HAVE_STDARG_H */ #if HAVE_VARARGS_H #include #undef HAVE_STDARGS @@ -27,7 +27,7 @@ #define VA_SHIFT(v,t) v = va_arg(ap,t) #define VA_END va_end(ap) -#else +#else /* !HAVE_VARARGS_H*/ #error XX **NO VARARGS ** XX #endif /* HAVE_VARARGS_H */ #endif /* HAVE_STDARG_H */ diff --git a/compat/strnstr.cc b/compat/strnstr.cc index 3551a3df72..779f5de08d 100644 --- a/compat/strnstr.cc +++ b/compat/strnstr.cc @@ -59,9 +59,7 @@ #if HAVE_SYS_TYPES_H #include #endif -#if HAVE_STRING_H -#include -#endif +#include /** * Find the first occurrence of find in s, where the search is limited to the diff --git a/compat/testPreCompiler.cc b/compat/testPreCompiler.cc index d131a12814..35aa00ebd5 100644 --- a/compat/testPreCompiler.cc +++ b/compat/testPreCompiler.cc @@ -1,9 +1,7 @@ #define SQUID_UNIT_TEST 1 #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif +#include #include "testPreCompiler.h" diff --git a/compat/xstrerror.cc b/compat/xstrerror.cc index 0db14307cc..f7752658ce 100644 --- a/compat/xstrerror.cc +++ b/compat/xstrerror.cc @@ -1,9 +1,7 @@ #include "squid.h" #include "compat/xstrerror.h" -#if HAVE_STRING_H -#include -#endif +#include #if _SQUID_WINDOWS_ static struct _wsaerrtext { diff --git a/configure.ac b/configure.ac index 15687a4eb5..33180cb980 100644 --- a/configure.ac +++ b/configure.ac @@ -2161,18 +2161,11 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS( \ - algorithm \ arpa/inet.h \ arpa/nameser.h \ assert.h \ bstring.h \ - cassert \ crypt.h \ - cstdarg \ - cstdio \ - cstdlib \ - cstring \ - list \ ctype.h \ errno.h \ execinfo.h \ @@ -2182,11 +2175,6 @@ AC_CHECK_HEADERS( \ glob.h \ gnumalloc.h \ grp.h \ - iosfwd \ - iomanip \ - iostream \ - fstream \ - climits \ ip_compat.h \ ip_fil_compat.h \ ip_fil.h \ @@ -2195,16 +2183,13 @@ AC_CHECK_HEADERS( \ lber.h \ ldap.h \ libc.h \ - limits \ limits.h \ linux/posix_types.h \ linux/types.h \ machine/byte_swap.h \ malloc.h \ - map \ math.h \ memory.h \ - memory \ mount.h \ netdb.h \ netinet/in.h \ @@ -2218,7 +2203,6 @@ AC_CHECK_HEADERS( \ netinet/tcp.h \ openssl/engine.h \ openssl/txt_db.h \ - ostream \ paths.h \ poll.h \ pwd.h \ @@ -2227,14 +2211,11 @@ AC_CHECK_HEADERS( \ sched.h \ siginfo.h \ signal.h \ - sstream \ stdarg.h \ stdbool.h \ stddef.h \ - stdexcept \ stdio.h \ stdlib.h \ - string \ string.h \ strings.h \ sys/bitypes.h \ diff --git a/contrib/rredir.c b/contrib/rredir.c index 9dfcc855f1..4017191fc3 100644 --- a/contrib/rredir.c +++ b/contrib/rredir.c @@ -35,7 +35,6 @@ * - initial version (Richard Huveneers ) */ -#include #include #include #include diff --git a/helpers/basic_auth/LDAP/basic_ldap_auth.cc b/helpers/basic_auth/LDAP/basic_ldap_auth.cc index c580df076c..0b3fa13034 100644 --- a/helpers/basic_auth/LDAP/basic_ldap_auth.cc +++ b/helpers/basic_auth/LDAP/basic_ldap_auth.cc @@ -89,9 +89,8 @@ #include "rfc1738.h" #include "util.h" -#include -#include -#include +#include +#include #if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf diff --git a/helpers/basic_auth/MSNT/allowusers.cc b/helpers/basic_auth/MSNT/allowusers.cc index 32f09a4ca8..b7bfab4e26 100644 --- a/helpers/basic_auth/MSNT/allowusers.cc +++ b/helpers/basic_auth/MSNT/allowusers.cc @@ -10,13 +10,14 @@ * The code originated from denyusers.c. */ -#include +#include "msntauth.h" +#include "usersfile.h" + +#include +#include #include #include #include -#include -#include "msntauth.h" -#include "usersfile.h" static usersfile AllowUsers; static int init = 0; diff --git a/helpers/basic_auth/MSNT/confload.cc b/helpers/basic_auth/MSNT/confload.cc index 7a0e1f04df..cfcb1961f2 100644 --- a/helpers/basic_auth/MSNT/confload.cc +++ b/helpers/basic_auth/MSNT/confload.cc @@ -13,14 +13,13 @@ /* Squid provides a number of portability overrides */ #include "squid.h" -#include -#include -#include +#include +#include +#include +#include #include -#include #include #include -#include #include "msntauth.h" #include "valid.h" diff --git a/helpers/basic_auth/MSNT/denyusers.cc b/helpers/basic_auth/MSNT/denyusers.cc index c1d7cc00a7..2142f29528 100644 --- a/helpers/basic_auth/MSNT/denyusers.cc +++ b/helpers/basic_auth/MSNT/denyusers.cc @@ -9,15 +9,15 @@ * have been explicitly denied by the system administrator. * Routines at the bottom also use the allowed user functions. */ +#include "msntauth.h" +#include "usersfile.h" -#include +#include +#include +#include #include -#include #include #include -#include -#include "msntauth.h" -#include "usersfile.h" static usersfile DenyUsers; static int init = 0; diff --git a/helpers/basic_auth/MSNT/msntauth.cc b/helpers/basic_auth/MSNT/msntauth.cc index 49adc2bf39..95eb7fe55d 100644 --- a/helpers/basic_auth/MSNT/msntauth.cc +++ b/helpers/basic_auth/MSNT/msntauth.cc @@ -33,10 +33,9 @@ #include "rfc1738.h" #include "util.h" -#include -#include +#include +#include #include -#include #include "msntauth.h" diff --git a/helpers/basic_auth/MSNT/usersfile.cc b/helpers/basic_auth/MSNT/usersfile.cc index 64271d13cb..1b08f6ce1c 100644 --- a/helpers/basic_auth/MSNT/usersfile.cc +++ b/helpers/basic_auth/MSNT/usersfile.cc @@ -11,14 +11,13 @@ #include "squid.h" #include "util.h" -#include -#include +#include +#include +#include +#include #include #include #include -#include -#include -#include #include #include diff --git a/helpers/basic_auth/NCSA/basic_ncsa_auth.cc b/helpers/basic_auth/NCSA/basic_ncsa_auth.cc index c65330e8da..781e21d89a 100644 --- a/helpers/basic_auth/NCSA/basic_ncsa_auth.cc +++ b/helpers/basic_auth/NCSA/basic_ncsa_auth.cc @@ -23,24 +23,17 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_CRYPT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif static hash_table *hash = NULL; static HASHFREE my_free; diff --git a/helpers/basic_auth/NCSA/crypt_md5.cc b/helpers/basic_auth/NCSA/crypt_md5.cc index 5390d746f4..7583f2785d 100644 --- a/helpers/basic_auth/NCSA/crypt_md5.cc +++ b/helpers/basic_auth/NCSA/crypt_md5.cc @@ -15,17 +15,11 @@ * */ #include "squid.h" - -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif - #include "crypt_md5.h" #include "md5.h" +#include + static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; diff --git a/helpers/basic_auth/NIS/basic_nis_auth.cc b/helpers/basic_auth/NIS/basic_nis_auth.cc index 9a0068dcfd..3ba4b19585 100644 --- a/helpers/basic_auth/NIS/basic_nis_auth.cc +++ b/helpers/basic_auth/NIS/basic_nis_auth.cc @@ -9,18 +9,11 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_SYS_TYPES_H #include #endif diff --git a/helpers/basic_auth/NIS/nis_support.cc b/helpers/basic_auth/NIS/nis_support.cc index 01657199ae..133b043dae 100644 --- a/helpers/basic_auth/NIS/nis_support.cc +++ b/helpers/basic_auth/NIS/nis_support.cc @@ -3,15 +3,8 @@ */ #include "squid.h" -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include #if HAVE_SYSLOG_H #include #endif diff --git a/helpers/basic_auth/PAM/basic_pam_auth.cc b/helpers/basic_auth/PAM/basic_pam_auth.cc index 86fe23eb71..2d353e80cd 100644 --- a/helpers/basic_auth/PAM/basic_pam_auth.cc +++ b/helpers/basic_auth/PAM/basic_pam_auth.cc @@ -68,21 +68,10 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_ASSERT_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_TIME_H -#include -#endif +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif diff --git a/helpers/basic_auth/RADIUS/basic_radius_auth.cc b/helpers/basic_auth/RADIUS/basic_radius_auth.cc index 4b8f7dac4e..b093662294 100644 --- a/helpers/basic_auth/RADIUS/basic_radius_auth.cc +++ b/helpers/basic_auth/RADIUS/basic_radius_auth.cc @@ -51,6 +51,10 @@ #include "radius-util.h" #include "radius.h" +#include +#include +#include +#include #if HAVE_SYS_SOCKET_H #include #endif @@ -66,12 +70,6 @@ #if _SQUID_WINDOWS_ #include #endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_UNISTD_H #include #endif @@ -81,18 +79,9 @@ #if HAVE_PWD_H #include #endif -#if HAVE_TIME_H -#include -#endif -#if HAVE_STRING_H -#include -#endif #if HAVE_GETOPT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif /* AYJ: helper input buffer may be a lot larger than this used to expect... */ #define MAXPWNAM 254 diff --git a/helpers/basic_auth/RADIUS/radius-util.cc b/helpers/basic_auth/RADIUS/radius-util.cc index af060c60a2..142ab0864c 100644 --- a/helpers/basic_auth/RADIUS/radius-util.cc +++ b/helpers/basic_auth/RADIUS/radius-util.cc @@ -37,35 +37,24 @@ char util_sccsid[] = " 2.1 Copyright 1997 Cistron Internet Services B.V."; #include "squid.h" +#include "md5.h" +#include "radius-util.h" +#include +#include +#include #if HAVE_SYS_SOCKET_H -#include +#include #endif #if HAVE_NETINET_IN_H -#include -#endif - -#if HAVE_STDIO_H -#include +#include #endif #if HAVE_NETDB_H -#include +#include #endif #if HAVE_PWD_H -#include -#endif -#if HAVE_TIME_H -#include +#include #endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_SIGNAL_H -#include -#endif - -#include "md5.h" -#include "radius-util.h" /* * Check for valid IP address in standard dot notation. diff --git a/helpers/basic_auth/SASL/basic_sasl_auth.cc b/helpers/basic_auth/SASL/basic_sasl_auth.cc index 46ae66e610..95e47d4b3e 100644 --- a/helpers/basic_auth/SASL/basic_sasl_auth.cc +++ b/helpers/basic_auth/SASL/basic_sasl_auth.cc @@ -29,18 +29,9 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include +#include #if HAVE_SASL_SASL_H #include #else diff --git a/helpers/basic_auth/SMB/basic_smb_auth.cc b/helpers/basic_auth/SMB/basic_smb_auth.cc index c89dc4ea30..2c36e9b641 100644 --- a/helpers/basic_auth/SMB/basic_smb_auth.cc +++ b/helpers/basic_auth/SMB/basic_smb_auth.cc @@ -45,12 +45,7 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include #define NMB_UNICAST 1 #define NMB_BROADCAST 2 diff --git a/helpers/basic_auth/SSPI/basic_sspi_auth.cc b/helpers/basic_auth/SSPI/basic_sspi_auth.cc index ce8c71bc88..38905510b4 100644 --- a/helpers/basic_auth/SSPI/basic_sspi_auth.cc +++ b/helpers/basic_auth/SSPI/basic_sspi_auth.cc @@ -30,9 +30,6 @@ #include "util.h" #include "valid.h" -#if HAVE_STDIO_H -#include -#endif #if GETOPT_H #include #endif diff --git a/helpers/basic_auth/SSPI/valid.h b/helpers/basic_auth/SSPI/valid.h index 167d419790..d47e1988d8 100644 --- a/helpers/basic_auth/SSPI/valid.h +++ b/helpers/basic_auth/SSPI/valid.h @@ -61,7 +61,6 @@ extern const char * errormsg; /* Debugging stuff */ #if defined(__GNUC__) /* this is really a gcc-ism */ -#include #include static char *__foo; #define debug(X...) if (debug_enabled) { \ diff --git a/helpers/basic_auth/fake/fake.cc b/helpers/basic_auth/fake/fake.cc index 65a76be56b..d256a9d6af 100644 --- a/helpers/basic_auth/fake/fake.cc +++ b/helpers/basic_auth/fake/fake.cc @@ -15,12 +15,7 @@ #include "squid.h" #include "helpers/defines.h" -#if HAVE_CSTRING #include -#endif -#if HAVE_STRING_H -#include -#endif /** * options: diff --git a/helpers/basic_auth/getpwnam/basic_getpwnam_auth.cc b/helpers/basic_auth/getpwnam/basic_getpwnam_auth.cc index bb501b0f7e..a33b68da18 100644 --- a/helpers/basic_auth/getpwnam/basic_getpwnam_auth.cc +++ b/helpers/basic_auth/getpwnam/basic_getpwnam_auth.cc @@ -27,20 +27,12 @@ #include "squid.h" #include "helpers/defines.h" #include "rfc1738.h" -//#include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_CRYPT_H #include #endif diff --git a/helpers/digest_auth/LDAP/digest_common.h b/helpers/digest_auth/LDAP/digest_common.h index 8834eabd70..1c288188ea 100644 --- a/helpers/digest_auth/LDAP/digest_common.h +++ b/helpers/digest_auth/LDAP/digest_common.h @@ -11,21 +11,12 @@ #ifndef SQUID_DIGEST_COMMON_H_ #define SQUID_DIGEST_COMMON_H_ -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif +#include +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_SYS_TYPES_H #include #endif diff --git a/helpers/digest_auth/eDirectory/digest_common.h b/helpers/digest_auth/eDirectory/digest_common.h index 02ac4225c5..bbad836a4c 100644 --- a/helpers/digest_auth/eDirectory/digest_common.h +++ b/helpers/digest_auth/eDirectory/digest_common.h @@ -11,21 +11,12 @@ #ifndef SQUID_DIGEST_COMMON_H_ #define SQUID_DIGEST_COMMON_H_ -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif +#include +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_STRINGS_H #include #endif diff --git a/helpers/digest_auth/file/digest_common.h b/helpers/digest_auth/file/digest_common.h index f7dfaa8e6b..41258faa6a 100644 --- a/helpers/digest_auth/file/digest_common.h +++ b/helpers/digest_auth/file/digest_common.h @@ -15,15 +15,10 @@ #include "rfc2617.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_SYS_STAT_H #include #endif diff --git a/helpers/external_acl/AD_group/ext_ad_group_acl.cc b/helpers/external_acl/AD_group/ext_ad_group_acl.cc index c3d35847d1..c3c2578624 100644 --- a/helpers/external_acl/AD_group/ext_ad_group_acl.cc +++ b/helpers/external_acl/AD_group/ext_ad_group_acl.cc @@ -66,20 +66,13 @@ int _wcsicmp(const wchar_t *, const wchar_t *); #endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#undef assert +#include +#include +#include #if HAVE_GETOPT_H #include #endif -#undef assert -#include #include #include #include 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 28d97ee372..e24007597c 100644 --- a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc +++ b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc @@ -41,15 +41,8 @@ #define LDAP_DEPRECATED 1 -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif +#include +#include #if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ diff --git a/helpers/external_acl/LM_group/ext_lm_group_acl.cc b/helpers/external_acl/LM_group/ext_lm_group_acl.cc index b0c4a64ca4..038f77e4e8 100644 --- a/helpers/external_acl/LM_group/ext_lm_group_acl.cc +++ b/helpers/external_acl/LM_group/ext_lm_group_acl.cc @@ -77,20 +77,13 @@ int _wcsicmp(const wchar_t *, const wchar_t *); #endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#undef assert +#include +#include +#include #if HAVE_GETOPT_H #include #endif -#undef assert -#include #include #include #include diff --git a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc index a38cc044b6..9d186c63a4 100644 --- a/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc +++ b/helpers/external_acl/eDirectory_userip/ext_edirectory_userip_acl.cc @@ -35,30 +35,19 @@ #define EDUI_PROGRAM_VERSION "2.1" /* System includes */ -#ifdef HAVE_STDIO_H -#include -#endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifndef __USE_GNU #define __USE_GNU #endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif -#ifdef HAVE_CTYPE_H -#include -#endif -#ifdef HAVE_ERRNO_H -#include -#endif -#ifdef HAVE_SIGNAL_H -#include -#endif +#include +#include +#include +#include +#include +#include +#include #ifdef HAVE_ARPA_INET_H #include #endif @@ -69,12 +58,6 @@ #ifdef HAVE_LDAP_H #include #endif -#ifdef HAVE_STDARG_H -#include -#endif -#ifdef HAVE_TIME_H -#include -#endif #ifdef HELPER_INPUT_BUFFER #define EDUI_MAXLEN HELPER_INPUT_BUFFER diff --git a/helpers/external_acl/file_userip/ext_file_userip_acl.cc b/helpers/external_acl/file_userip/ext_file_userip_acl.cc index d359d79b40..7780b7e05b 100644 --- a/helpers/external_acl/file_userip/ext_file_userip_acl.cc +++ b/helpers/external_acl/file_userip/ext_file_userip_acl.cc @@ -23,15 +23,8 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include #if HAVE_SYS_SOCKET_H #include #endif diff --git a/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc b/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc index 08bdb97d44..73211d943c 100644 --- a/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc +++ b/helpers/external_acl/kerberos_ldap_group/kerberos_ldap_group.cc @@ -37,9 +37,7 @@ #ifdef HAVE_LDAP #include "support.h" -#ifdef HAVE_CTYPE_H -#include -#endif +#include void init_args(struct main_args *margs) @@ -420,8 +418,7 @@ strup(char *s) } #else -#include -#include +#include int main(int argc, char *const argv[]) { diff --git a/helpers/external_acl/kerberos_ldap_group/support.h b/helpers/external_acl/kerberos_ldap_group/support.h index 12dbb70ec0..127b5340d6 100644 --- a/helpers/external_acl/kerberos_ldap_group/support.h +++ b/helpers/external_acl/kerberos_ldap_group/support.h @@ -24,9 +24,7 @@ #define KERBEROS_LDAP_GROUP_VERSION "1.3.1sq" -#if HAVE_STRING_H -#include -#endif +#include #if HAVE_KRB5_H #if HAVE_BROKEN_SOLARIS_KRB5_H diff --git a/helpers/external_acl/kerberos_ldap_group/support_log.cc b/helpers/external_acl/kerberos_ldap_group/support_log.cc index 56bcdab05e..f63ae400f3 100644 --- a/helpers/external_acl/kerberos_ldap_group/support_log.cc +++ b/helpers/external_acl/kerberos_ldap_group/support_log.cc @@ -27,9 +27,7 @@ #ifdef HAVE_LDAP #include "support.h" -#ifdef HAVE_TIME_H -#include -#endif +#include const char * LogTime() diff --git a/helpers/external_acl/session/ext_session_acl.cc b/helpers/external_acl/session/ext_session_acl.cc index f63a7b86ce..d03a4d3198 100644 --- a/helpers/external_acl/session/ext_session_acl.cc +++ b/helpers/external_acl/session/ext_session_acl.cc @@ -23,6 +23,9 @@ #endif #include "helpers/defines.h" +#include +#include +#include #if HAVE_DB_H #include #endif @@ -30,12 +33,8 @@ #if HAVE_GETOPT_H #include #endif -#include -#include -#include #include #include -#include #if HAVE_UNISTD_H #include #endif diff --git a/helpers/external_acl/time_quota/ext_time_quota_acl.cc b/helpers/external_acl/time_quota/ext_time_quota_acl.cc index 40f0c35aba..9b3ec249a8 100644 --- a/helpers/external_acl/time_quota/ext_time_quota_acl.cc +++ b/helpers/external_acl/time_quota/ext_time_quota_acl.cc @@ -18,22 +18,19 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#if HAVE_CONFIG_H #include "squid.h" -#endif #include "helpers/defines.h" +#include +#include +#include +#include #include #include #include -#include -#include -#include #if HAVE_UNISTD_H #include #endif -#include -#include #if HAVE_GETOPT_H #include #endif diff --git a/helpers/external_acl/unix_group/check_group.cc b/helpers/external_acl/unix_group/check_group.cc index 4c9508e1e1..bfd533145e 100644 --- a/helpers/external_acl/unix_group/check_group.cc +++ b/helpers/external_acl/unix_group/check_group.cc @@ -58,12 +58,8 @@ #include "rfc1738.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include #if HAVE_GRP_H #include #endif @@ -73,9 +69,6 @@ #if HAVE_PWD_H #include #endif -#if HAVE_CTYPE_H -#include -#endif /* * Verify if user's primary group matches groupname diff --git a/helpers/log_daemon/file/log_file_daemon.cc b/helpers/log_daemon/file/log_file_daemon.cc index 5c365891d3..ce068d1f67 100644 --- a/helpers/log_daemon/file/log_file_daemon.cc +++ b/helpers/log_daemon/file/log_file_daemon.cc @@ -1,32 +1,21 @@ #include "squid.h" -#if HAVE_STDIO_H -#include -#endif +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif #if HAVE_FCNTL_H #include #endif -#if HAVE_ASSERT_H -#include -#endif #if HAVE_SYS_PARAM_H #include #endif #if HAVE_SYS_STAT_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif #if HAVE_PATHS_H #include #endif diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos.h b/helpers/negotiate_auth/kerberos/negotiate_kerberos.h index 0743d81ece..0ecac334d6 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos.h +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos.h @@ -27,21 +27,14 @@ * ----------------------------------------------------------------------------- */ -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif +#include +#include #if HAVE_NETDB_H #include #endif #if HAVE_UNISTD_H #include #endif -#if HAVE_TIME_H -#include -#endif #include "base64.h" #include "util.h" diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc index 511e862458..d9fea871f2 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth.cc @@ -492,8 +492,7 @@ cleanup: } } #else -#include -#include +#include #ifndef MAX_AUTHTOKEN_LEN #define MAX_AUTHTOKEN_LEN 65535 #endif diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc index 141ab82adf..f5d358e2db 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc @@ -29,24 +29,15 @@ #if HAVE_GSSAPI -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif +#include +#include +#include #if HAVE_NETDB_H #include #endif #if HAVE_UNISTD_H #include #endif -#if HAVE_TIME_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif #include "base64.h" #include "util.h" @@ -238,7 +229,7 @@ main(int argc, char *argv[]) } #else -#include +#include int main(int argc, char *argv[]) { diff --git a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc index 0d1d2dd2cc..0f583c8b55 100644 --- a/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc +++ b/helpers/negotiate_auth/wrapper/negotiate_wrapper.cc @@ -28,27 +28,16 @@ #include "squid.h" #include "base64.h" -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif +#include +#include +#include +#include #if HAVE_NETDB_H #include #endif #if HAVE_UNISTD_H #include #endif -#if HAVE_TIME_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif #if !defined(HAVE_DECL_XMALLOC) || !HAVE_DECL_XMALLOC #define xmalloc malloc diff --git a/helpers/ntlm_auth/fake/ntlm_fake_auth.cc b/helpers/ntlm_auth/fake/ntlm_fake_auth.cc index c8ec4de987..f4a2fb3b60 100644 --- a/helpers/ntlm_auth/fake/ntlm_fake_auth.cc +++ b/helpers/ntlm_auth/fake/ntlm_fake_auth.cc @@ -56,14 +56,9 @@ #include "helpers/defines.h" #include "ntlmauth/ntlmauth.h" #include "ntlmauth/support_bits.cci" -//#include "util.h" -#if HAVE_STRING_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif +#include +#include #if HAVE_CRYPT_H #include #endif @@ -73,9 +68,6 @@ #if HAVE_GETOPT_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_STDINT_H #include #endif diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc index 015d381f37..d4172142d7 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc @@ -20,41 +20,23 @@ #include "ntlmauth/support_bits.cci" #include "rfcnb/rfcnb.h" #include "smblib/smblib.h" -//#include "util.h" -#if HAVE_STRING_H -#include -#endif +#include +#include +#include +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif #if HAVE_GETOPT_H #include #endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif #if HAVE_UNISTD_H #include #endif -#if HAVE_ASSERT_H -#include -#endif -#if HAVE_TIME_H -#include -#endif /************* CONFIGURATION ***************/ diff --git a/helpers/url_rewrite/fake/fake.cc b/helpers/url_rewrite/fake/fake.cc index d18053c40d..e1016db788 100644 --- a/helpers/url_rewrite/fake/fake.cc +++ b/helpers/url_rewrite/fake/fake.cc @@ -15,12 +15,7 @@ #include "squid.h" #include "helpers/defines.h" -#if HAVE_CSTRING #include -#endif -#if HAVE_STRING_H -#include -#endif /** * options: diff --git a/include/Range.h b/include/Range.h index 0f690ed23c..812f86c34f 100644 --- a/include/Range.h +++ b/include/Range.h @@ -31,12 +31,8 @@ #ifndef SQUID_RANGE_H #define SQUID_RANGE_H -#if HAVE_IOSFWD #include -#endif -#if HAVE_OSTREAM #include -#endif /* represents [start, end) */ diff --git a/include/util.h b/include/util.h index 08174754f4..34198cb2b8 100644 --- a/include/util.h +++ b/include/util.h @@ -32,9 +32,6 @@ #ifndef SQUID_UTIL_H #define SQUID_UTIL_H -#if HAVE_STDIO_H -#include -#endif #if HAVE_TIME_H #include #endif diff --git a/lib/MemPool.cc b/lib/MemPool.cc index 82ee559c4d..3ab20e431f 100644 --- a/lib/MemPool.cc +++ b/lib/MemPool.cc @@ -32,9 +32,8 @@ */ #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif + +#include #include "MemPool.h" #include "MemPoolChunked.h" @@ -42,9 +41,7 @@ #define FLUSH_LIMIT 1000 /* Flush memPool counters to memMeters after flush limit calls */ -#if HAVE_STRING_H -#include -#endif +#include /* * XXX This is a boundary violation between lib and src.. would be good diff --git a/lib/MemPoolChunked.cc b/lib/MemPoolChunked.cc index 7a12e6e662..14d8f2e2c7 100644 --- a/lib/MemPoolChunked.cc +++ b/lib/MemPoolChunked.cc @@ -80,17 +80,14 @@ */ #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif + +#include #include "MemPoolChunked.h" #define MEM_MAX_MMAP_CHUNKS 2048 -#if HAVE_STRING_H -#include -#endif +#include /* * XXX This is a boundary violation between lib and src.. would be good diff --git a/lib/MemPoolMalloc.cc b/lib/MemPoolMalloc.cc index bc5d369021..f0fe52fe98 100644 --- a/lib/MemPoolMalloc.cc +++ b/lib/MemPoolMalloc.cc @@ -32,15 +32,10 @@ */ #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif - #include "MemPoolMalloc.h" -#if HAVE_STRING_H -#include -#endif +#include +#include /* * XXX This is a boundary violation between lib and src.. would be good diff --git a/lib/Splay.cc b/lib/Splay.cc index 125eb26ac4..220a2f9eee 100644 --- a/lib/Splay.cc +++ b/lib/Splay.cc @@ -5,12 +5,7 @@ #include "squid.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif +#include #if HAVE_UNISTD_H #include #endif diff --git a/lib/base64.c b/lib/base64.c index 6fd2dea973..70e7fb2ae6 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -7,9 +7,6 @@ #include "squid.h" #include "base64.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STDLIB_H #include #endif diff --git a/lib/getopt.c b/lib/getopt.c index a4083f5fbe..6249719459 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -33,7 +33,6 @@ static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95"; #endif /* LIBC_SCCS and not lint */ -#include #include #include diff --git a/lib/hash.cc b/lib/hash.cc index 5cbc080e9c..d764bdfc82 100644 --- a/lib/hash.cc +++ b/lib/hash.cc @@ -35,15 +35,10 @@ #include "hash.h" #include "profiler/Profiler.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif @@ -52,12 +47,6 @@ #elif HAVE_MALLOC_H #include #endif -#if HAVE_ASSERT_H -#include -#endif -#if HAVE_MATH_H -#include -#endif static void hash_next_bucket(hash_table * hid); diff --git a/lib/heap.c b/lib/heap.c index 7c18be4753..c2681ff7b3 100644 --- a/lib/heap.c +++ b/lib/heap.c @@ -47,9 +47,6 @@ #if HAVE_STRING_H #include #endif -#if HAVE_STDIO_H -#include -#endif #include "util.h" diff --git a/lib/html_quote.c b/lib/html_quote.c index e18f53af82..17b5f5adda 100644 --- a/lib/html_quote.c +++ b/lib/html_quote.c @@ -33,9 +33,6 @@ #include "squid.h" #include "html_quote.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/lib/iso3307.c b/lib/iso3307.c index 2df9515959..00be05fa33 100644 --- a/lib/iso3307.c +++ b/lib/iso3307.c @@ -1,9 +1,6 @@ #include "squid.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/lib/libTrie/test/trie-c.c b/lib/libTrie/test/trie-c.c index e9ceff4dc3..39bd82facf 100644 --- a/lib/libTrie/test/trie-c.c +++ b/lib/libTrie/test/trie-c.c @@ -19,7 +19,6 @@ #include "squid.h" #include "Trie.h" -#include int main (int argc, char **argv) diff --git a/lib/libTrie/test/trie.cc b/lib/libTrie/test/trie.cc index 8404ff409e..13bcd32e28 100644 --- a/lib/libTrie/test/trie.cc +++ b/lib/libTrie/test/trie.cc @@ -21,9 +21,7 @@ #include "libTrie/Trie.h" #include "libTrie/TrieCharTransform.h" -#if HAVE_IOSTREAM #include -#endif bool CaseSensitiveCheck() diff --git a/lib/malloc_trace.cc b/lib/malloc_trace.cc index 358e01b6c3..899dff9089 100644 --- a/lib/malloc_trace.cc +++ b/lib/malloc_trace.cc @@ -36,15 +36,11 @@ #include "profiler/Profiler.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif +#include +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif @@ -53,15 +49,6 @@ #elif HAVE_MALLOC_H #include #endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_MATH_H -#include -#endif -#if HAVE_ASSERT_H -#include -#endif #if MEM_GEN_TRACE diff --git a/lib/md5-test.c b/lib/md5-test.c index c78c99d415..23b1f25e7b 100644 --- a/lib/md5-test.c +++ b/lib/md5-test.c @@ -5,7 +5,7 @@ #include "squid.h" #include "md5.h" -#include "stdio.h" +//#include "stdio.h" // ??? static void MDPrint(unsigned char digest[16]); static void MDString(char *string); diff --git a/lib/ntlmauth/ntlmauth.cc b/lib/ntlmauth/ntlmauth.cc index c1435bc9de..fb2ec250e5 100644 --- a/lib/ntlmauth/ntlmauth.cc +++ b/lib/ntlmauth/ntlmauth.cc @@ -25,9 +25,7 @@ #include "squid.h" -#if HAVE_STRING_H -#include -#endif +#include #if HAVE_STRINGS_H #include #endif diff --git a/lib/profiler/Profiler.cc b/lib/profiler/Profiler.cc index 5e215ebf2e..6661c5e791 100644 --- a/lib/profiler/Profiler.cc +++ b/lib/profiler/Profiler.cc @@ -116,9 +116,7 @@ #if USE_XPROF_STATS -#if HAVE_ASSERT_H -#include -#endif +#include #if HAVE_GNUMALLLOC_H #include #elif HAVE_MALLOC_H diff --git a/lib/radix.c b/lib/radix.c index 12d3dee326..0ad361c882 100644 --- a/lib/radix.c +++ b/lib/radix.c @@ -71,9 +71,6 @@ #if HAVE_STDLIB_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_SYS_TYPES_H #include #endif diff --git a/lib/rfc1035.c b/lib/rfc1035.c index a262ab7b52..4a22436a7e 100644 --- a/lib/rfc1035.c +++ b/lib/rfc1035.c @@ -39,9 +39,6 @@ #include "squid.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/lib/rfc1123.c b/lib/rfc1123.c index d4297e3b5a..f54f6eec7d 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -37,9 +37,6 @@ * Adapted from HTSUtils.c in CERN httpd 3.0 (http://info.cern.ch/httpd/) * by Darren Hardy , November 1994. */ -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/lib/rfc1738.c b/lib/rfc1738.c index 612d6d438f..03d90a5d60 100644 --- a/lib/rfc1738.c +++ b/lib/rfc1738.c @@ -33,9 +33,6 @@ #include "squid.h" #include "rfc1738.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/lib/rfc3596.c b/lib/rfc3596.c index 7d4a2a2226..c80673b451 100644 --- a/lib/rfc3596.c +++ b/lib/rfc3596.c @@ -57,9 +57,6 @@ #include "compat/inet_pton.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_UNISTD_H #include #endif diff --git a/lib/rfcnb/std-includes.h b/lib/rfcnb/std-includes.h index 8dbda9d6e8..ff3bcfc1f9 100644 --- a/lib/rfcnb/std-includes.h +++ b/lib/rfcnb/std-includes.h @@ -41,7 +41,6 @@ typedef short int16; #endif #include #include -#include #include #define TRUE 1 diff --git a/lib/smblib/smb-errors.c b/lib/smblib/smb-errors.c index 9d30d2ee4e..80f355f7d8 100644 --- a/lib/smblib/smb-errors.c +++ b/lib/smblib/smb-errors.c @@ -31,8 +31,6 @@ /* ensure we don't overwrite strings when not passed enough space. Also */ /* added code to say unknown error codes if we see any */ -#include - typedef struct { char *name; int code; diff --git a/lib/smblib/std-defines.h b/lib/smblib/std-defines.h index 9cac7b1e33..d6a3d2137b 100644 --- a/lib/smblib/std-defines.h +++ b/lib/smblib/std-defines.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include diff --git a/lib/snmplib/asn1.c b/lib/snmplib/asn1.c index 4b5fd61780..34fc659cad 100644 --- a/lib/snmplib/asn1.c +++ b/lib/snmplib/asn1.c @@ -33,8 +33,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/coexistance.c b/lib/snmplib/coexistance.c index dd8e209b60..9fab1a7a73 100644 --- a/lib/snmplib/coexistance.c +++ b/lib/snmplib/coexistance.c @@ -29,8 +29,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/mib.c b/lib/snmplib/mib.c index 707f307f7a..a868fd1edf 100644 --- a/lib/snmplib/mib.c +++ b/lib/snmplib/mib.c @@ -24,8 +24,6 @@ SOFTWARE. #define SQUID_NO_STRING_BUFFER_PROTECT 1 #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/parse.c b/lib/snmplib/parse.c index 4cc978e249..fad5a8d544 100644 --- a/lib/snmplib/parse.c +++ b/lib/snmplib/parse.c @@ -32,8 +32,6 @@ SOFTWARE. #include "snmp_vars.h" #include "util.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/snmp_api.c b/lib/snmplib/snmp_api.c index ba6703d0f7..c5ddbc7ba6 100644 --- a/lib/snmplib/snmp_api.c +++ b/lib/snmplib/snmp_api.c @@ -25,8 +25,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/snmp_api_error.c b/lib/snmplib/snmp_api_error.c index 4257faafe7..bebf939ed1 100644 --- a/lib/snmplib/snmp_api_error.c +++ b/lib/snmplib/snmp_api_error.c @@ -31,8 +31,6 @@ ***************************************************************************/ #include "squid.h" - -#include #include "snmp_api_error.h" /*************************************************************************** diff --git a/lib/snmplib/snmp_error.c b/lib/snmplib/snmp_error.c index 93518ee68b..1af437b5eb 100644 --- a/lib/snmplib/snmp_error.c +++ b/lib/snmplib/snmp_error.c @@ -27,9 +27,6 @@ **********************************************************************/ #include "squid.h" - -#include - #include "snmp_error.h" static const char *error_string[25] = { diff --git a/lib/snmplib/snmp_msg.c b/lib/snmplib/snmp_msg.c index 985ad43b01..04c98aebc4 100644 --- a/lib/snmplib/snmp_msg.c +++ b/lib/snmplib/snmp_msg.c @@ -35,8 +35,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/snmp_pdu.c b/lib/snmplib/snmp_pdu.c index 44a4d25715..4b783c4e65 100644 --- a/lib/snmplib/snmp_pdu.c +++ b/lib/snmplib/snmp_pdu.c @@ -35,8 +35,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/snmp_vars.c b/lib/snmplib/snmp_vars.c index a05f14d373..6413ed571e 100644 --- a/lib/snmplib/snmp_vars.c +++ b/lib/snmplib/snmp_vars.c @@ -34,8 +34,6 @@ #include "squid.h" -#include - #if HAVE_UNISTD_H #include #endif diff --git a/lib/snmplib/snmplib_debug.c b/lib/snmplib/snmplib_debug.c index d6e5534e29..809e19b21f 100644 --- a/lib/snmplib/snmplib_debug.c +++ b/lib/snmplib/snmplib_debug.c @@ -1,7 +1,5 @@ #include "squid.h" -#if HAVE_STDIO_H -#include -#endif + #if HAVE_SYS_TYPES_H #include #endif diff --git a/lib/tests/testRFC1035.cc b/lib/tests/testRFC1035.cc index 6e1228ce97..8b55820887 100644 --- a/lib/tests/testRFC1035.cc +++ b/lib/tests/testRFC1035.cc @@ -1,9 +1,7 @@ #define SQUID_UNIT_TEST 1 #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif +#include #include "testRFC1035.h" diff --git a/lib/tests/testRFC1738.cc b/lib/tests/testRFC1738.cc index b26d3f5742..54c32e2933 100644 --- a/lib/tests/testRFC1738.cc +++ b/lib/tests/testRFC1738.cc @@ -1,9 +1,7 @@ #define SQUID_UNIT_TEST 1 #include "squid.h" -#if HAVE_ASSERT_H -#include -#endif +#include #include "testRFC1738.h" diff --git a/lib/util.c b/lib/util.c index 123e7ad3f4..febabe5620 100644 --- a/lib/util.c +++ b/lib/util.c @@ -35,9 +35,6 @@ #include "squid.h" #include "util.h" -#if HAVE_STDIO_H -#include -#endif #if HAVE_STRING_H #include #endif diff --git a/src/ConfigParser.h b/src/ConfigParser.h index 1cc5295461..8e9fdee22a 100644 --- a/src/ConfigParser.h +++ b/src/ConfigParser.h @@ -35,11 +35,10 @@ #define SQUID_CONFIGPARSER_H #include "SquidString.h" + #include #include -#if HAVE_STRING #include -#endif class wordlist; /** diff --git a/src/CpuAffinitySet.cc b/src/CpuAffinitySet.cc index cd78545c2b..3af3a40e10 100644 --- a/src/CpuAffinitySet.cc +++ b/src/CpuAffinitySet.cc @@ -9,12 +9,8 @@ #include "Debug.h" #include "util.h" -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include CpuAffinitySet::CpuAffinitySet() { diff --git a/src/Debug.h b/src/Debug.h index 18c01ca491..3b69cac201 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -32,17 +32,10 @@ #ifndef SQUID_DEBUG_H #define SQUID_DEBUG_H -#if HAVE_IOSTREAM #include -#endif - #undef assert -#if HAVE_SSTREAM #include -#endif -#if HAVE_IOMANIP #include -#endif #if defined(assert) #undef assert #endif diff --git a/src/DiskIO/DiskDaemon/diskd.cc b/src/DiskIO/DiskDaemon/diskd.cc index c132ea6ee8..99ae833dbe 100644 --- a/src/DiskIO/DiskDaemon/diskd.cc +++ b/src/DiskIO/DiskDaemon/diskd.cc @@ -34,9 +34,8 @@ #include "DiskIO/DiskDaemon/diomsg.h" #include "hash.h" -#if HAVE_ERRNO_H -#include -#endif +#include +#include #if HAVE_SYS_IPC_H #include #endif @@ -46,9 +45,6 @@ #if HAVE_SYS_SHM_H #include #endif -#if HAVE_IOSTREAM -#include -#endif void xassert(const char *msg, const char *file, int line) diff --git a/src/DiskIO/DiskThreads/aiops.cc b/src/DiskIO/DiskThreads/aiops.cc index 725c9f461a..b18220837c 100644 --- a/src/DiskIO/DiskThreads/aiops.cc +++ b/src/DiskIO/DiskThreads/aiops.cc @@ -35,22 +35,21 @@ #endif #include "squid.h" +#include "DiskIO/DiskThreads/CommIO.h" #include "DiskThreads.h" #include "SquidConfig.h" +#include "SquidTime.h" +#include "Store.h" -#include +#include #include #include #include #include #include -#include #if HAVE_SCHED_H #include #endif -#include "DiskIO/DiskThreads/CommIO.h" -#include "SquidTime.h" -#include "Store.h" #define RIDICULOUS_LENGTH 4096 diff --git a/src/DiskIO/DiskThreads/aiops_win32.cc b/src/DiskIO/DiskThreads/aiops_win32.cc index 9701e7cbb1..4967789fe3 100644 --- a/src/DiskIO/DiskThreads/aiops_win32.cc +++ b/src/DiskIO/DiskThreads/aiops_win32.cc @@ -40,12 +40,11 @@ #include "SquidTime.h" #include "Store.h" -#include +#include #include #include #include #include -#include #define RIDICULOUS_LENGTH 4096 diff --git a/src/ETag.cc b/src/ETag.cc index 1438eca76a..192baf40ce 100644 --- a/src/ETag.cc +++ b/src/ETag.cc @@ -34,9 +34,7 @@ #include "squid.h" #include "ETag.h" -#if HAVE_CSTRING #include -#endif /* * Note: ETag is not an http "field" like, for example HttpHdrRange. ETag is a diff --git a/src/FadingCounter.cc b/src/FadingCounter.cc index 1dd0576fd3..95ecf7759e 100644 --- a/src/FadingCounter.cc +++ b/src/FadingCounter.cc @@ -3,9 +3,7 @@ #include "FadingCounter.h" #include "SquidTime.h" -#if HAVE_MATH_H -#include -#endif /* HAVE_MATH_H */ +#include FadingCounter::FadingCounter(): horizon(-1), precision(10), delta(-1), lastTime(0), total(0) diff --git a/src/Generic.h b/src/Generic.h index 1d4ddab8d9..1f7fbbf99b 100644 --- a/src/Generic.h +++ b/src/Generic.h @@ -32,9 +32,7 @@ #include "dlink.h" -#if HAVE_OSTREAM #include -#endif template struct unary_function { diff --git a/src/HelperChildConfig.cc b/src/HelperChildConfig.cc index f8359f84f4..884e4eff8b 100644 --- a/src/HelperChildConfig.cc +++ b/src/HelperChildConfig.cc @@ -6,7 +6,7 @@ #include "HelperChildConfig.h" #include "Parsing.h" -#include +#include HelperChildConfig::HelperChildConfig(const unsigned int m): n_max(m), diff --git a/src/HelperReply.h b/src/HelperReply.h index c0d7fc9491..56b45e4096 100644 --- a/src/HelperReply.h +++ b/src/HelperReply.h @@ -5,9 +5,7 @@ #include "MemBuf.h" #include "Notes.h" -#if HAVE_OSTREAM #include -#endif class helper_stateful_server; diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index b550ce720b..8d4f1ad908 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -41,9 +41,7 @@ #include "Store.h" #include "StrList.h" -#if HAVE_MAP #include -#endif /* a row in the table used for parsing cache control header and statistics */ typedef struct { diff --git a/src/HttpHdrSc.cc b/src/HttpHdrSc.cc index 523fe772fd..2eb20fd12b 100644 --- a/src/HttpHdrSc.cc +++ b/src/HttpHdrSc.cc @@ -44,9 +44,7 @@ #include "Store.h" #include "StrList.h" -#if HAVE_MAP #include -#endif /* a row in the table used for parsing surrogate-control header and statistics */ typedef struct { diff --git a/src/HttpHeaderTools.h b/src/HttpHeaderTools.h index ac273b3494..137afb1e37 100644 --- a/src/HttpHeaderTools.h +++ b/src/HttpHeaderTools.h @@ -6,18 +6,10 @@ #include "HttpHeader.h" #include "typedefs.h" -#if HAVE_FUNCTIONAL #include -#endif -#if HAVE_LIST #include -#endif -#if HAVE_MAP #include -#endif -#if HAVE_STRING #include -#endif #if HAVE_STRINGS_H #include #endif diff --git a/src/Mem.h b/src/Mem.h index 343e7719b5..f941ddb192 100644 --- a/src/Mem.h +++ b/src/Mem.h @@ -37,9 +37,7 @@ /* for FREE */ #include "typedefs.h" -#if HAVE_IOSFWD #include -#endif class StoreEntry; class MemPoolStats; diff --git a/src/MemBlob.cc b/src/MemBlob.cc index cc83aa9cd3..7662c11a4e 100644 --- a/src/MemBlob.cc +++ b/src/MemBlob.cc @@ -33,9 +33,7 @@ #include "MemBlob.h" #include "SBufDetailedStats.h" -#if HAVE_IOSTREAM #include -#endif MemBlobStats MemBlob::Stats; InstanceIdDefinitions(MemBlob, "blob"); diff --git a/src/Notes.h b/src/Notes.h index f485cf717f..274d3bb145 100644 --- a/src/Notes.h +++ b/src/Notes.h @@ -9,9 +9,7 @@ #include "SquidString.h" #include "typedefs.h" -#if HAVE_STRING #include -#endif #include class HttpRequest; diff --git a/src/Packer.h b/src/Packer.h index 5d224ff2d2..4ef5a4d6e0 100644 --- a/src/Packer.h +++ b/src/Packer.h @@ -36,9 +36,6 @@ class Packer; /* a common objPackInto interface; used by debugObj */ typedef void (*ObjPackMethod) (void *obj, Packer * p); -#if HAVE_STDIO_H -#include -#endif /* append/vprintf's for Packer */ typedef void (*append_f) (void *, const char *buf, int size); typedef void (*vprintf_f) (void *, const char *fmt, va_list args); diff --git a/src/SBuf.cc b/src/SBuf.cc index 08c6210bd8..56f981bf3b 100644 --- a/src/SBuf.cc +++ b/src/SBuf.cc @@ -36,17 +36,9 @@ #include "SBufExceptions.h" #include "util.h" -#if HAVE_STRING_H -#include -#endif - -#if HAVE_SSTREAM -#include -#endif - -#if HAVE_IOSTREAM +#include #include -#endif +#include #ifdef VA_COPY #undef VA_COPY diff --git a/src/SBuf.h b/src/SBuf.h index 67b6e665b0..31deb00882 100644 --- a/src/SBuf.h +++ b/src/SBuf.h @@ -34,20 +34,12 @@ #include "SBufExceptions.h" #include "SquidString.h" -#if HAVE_CLIMITS #include -#elif HAVE_LIMITS_H -#include -#endif +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STDARG_H -#include -#endif -#if HAVE_IOSFWD -#include -#endif /* SBuf placeholder for printf */ #ifndef SQUIDSBUFPH diff --git a/src/SBufStream.h b/src/SBufStream.h index d6574e9fbc..9c3aeeedfd 100644 --- a/src/SBufStream.h +++ b/src/SBufStream.h @@ -32,9 +32,7 @@ #include "SBuf.h" -#if HAVE_OSTREAM #include -#endif /** streambuf class for a SBuf-backed stream interface. * diff --git a/src/SquidString.h b/src/SquidString.h index a454f16146..c4081344b7 100644 --- a/src/SquidString.h +++ b/src/SquidString.h @@ -33,9 +33,7 @@ #ifndef SQUID_STRING_H #define SQUID_STRING_H -#if HAVE_OSTREAM #include -#endif /* squid string placeholder (for printf) */ #ifndef SQUIDSTRINGPH diff --git a/src/SquidTime.h b/src/SquidTime.h index 46a84a47c3..f5dbf4c284 100644 --- a/src/SquidTime.h +++ b/src/SquidTime.h @@ -34,9 +34,7 @@ #include "rfc1123.h" -#if HAVE_TIME_H -#include -#endif +#include /* NP: sys/time.h is provided by libcompat */ /* globals for accessing time */ diff --git a/src/StatHist.cc b/src/StatHist.cc index f22573b623..c7404a158a 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -34,9 +34,8 @@ #include "squid.h" #include "StatHist.h" -#if HAVE_MATH_H -#include -#endif +#include + /* Local functions */ static StatHistBinDumper statHistBinDumper; diff --git a/src/Store.h b/src/Store.h index c1fad115e9..241667358b 100644 --- a/src/Store.h +++ b/src/Store.h @@ -51,9 +51,7 @@ #include "esi/Element.h" #endif -#if HAVE_OSTREAM #include -#endif class AsyncCall; class HttpRequest; diff --git a/src/StoreEntryStream.h b/src/StoreEntryStream.h index 880405a41a..4659fad7f6 100644 --- a/src/StoreEntryStream.h +++ b/src/StoreEntryStream.h @@ -33,9 +33,7 @@ #include "Store.h" -#if HAVE_OSTREAM #include -#endif /* * This class provides a streambuf interface for writing diff --git a/src/String.cc b/src/String.cc index f0010cf1bd..f46c1e05b1 100644 --- a/src/String.cc +++ b/src/String.cc @@ -38,9 +38,7 @@ #include "profiler/Profiler.h" #include "Store.h" -#if HAVE_LIMITS_H -#include -#endif +#include int String::psize() const diff --git a/src/Transients.cc b/src/Transients.cc index ec14bda7f3..480e82e661 100644 --- a/src/Transients.cc +++ b/src/Transients.cc @@ -17,9 +17,7 @@ #include "tools.h" #include "Transients.h" -#if HAVE_LIMITS_H #include -#endif /// shared memory segment path to use for Transients maps static const char *MapLabel = "transients_map"; diff --git a/src/acl/Acl.h b/src/acl/Acl.h index 6996348aff..cbefd6423e 100644 --- a/src/acl/Acl.h +++ b/src/acl/Acl.h @@ -39,12 +39,8 @@ #include "dlink.h" #include "MemPool.h" -#if HAVE_OSTREAM #include -#endif -#if HAVE_STRING #include -#endif #include class ConfigParser; diff --git a/src/acl/Gadgets.h b/src/acl/Gadgets.h index 4f21fe11b5..962a2492af 100644 --- a/src/acl/Gadgets.h +++ b/src/acl/Gadgets.h @@ -4,9 +4,7 @@ #include "acl/forward.h" #include "err_type.h" -#if HAVE_SSTREAM #include -#endif class ConfigParser; class dlink_list; diff --git a/src/acl/HttpStatus.cc b/src/acl/HttpStatus.cc index f4e423ac43..f5cc88fd57 100644 --- a/src/acl/HttpStatus.cc +++ b/src/acl/HttpStatus.cc @@ -40,9 +40,7 @@ #include "HttpReply.h" #include "wordlist.h" -#if HAVE_LIMITS_H -#include -#endif +#include static void aclParseHTTPStatusList(SplayNode **curlist); static int aclHTTPStatusCompare(acl_httpstatus_data * const &a, acl_httpstatus_data * const &b); diff --git a/src/adaptation/ecap/ServiceRep.cc b/src/adaptation/ecap/ServiceRep.cc index bf0a7bb56c..2c50e5b7df 100644 --- a/src/adaptation/ecap/ServiceRep.cc +++ b/src/adaptation/ecap/ServiceRep.cc @@ -15,9 +15,7 @@ #include #include #include -#if HAVE_LIMITS #include -#endif #include /// libecap::adapter::services indexed by their URI diff --git a/src/anyp/PortCfg.cc b/src/anyp/PortCfg.cc index 7c96ad5db7..f72117d27c 100644 --- a/src/anyp/PortCfg.cc +++ b/src/anyp/PortCfg.cc @@ -7,9 +7,7 @@ #endif #include -#if HAVE_LIMITS #include -#endif CBDATA_NAMESPACED_CLASS_INIT(AnyP, PortCfg); diff --git a/src/anyp/ProtocolType.h b/src/anyp/ProtocolType.h index 4f5ab3b753..a40ac64073 100644 --- a/src/anyp/ProtocolType.h +++ b/src/anyp/ProtocolType.h @@ -1,9 +1,7 @@ #ifndef _SQUID_SRC_ANYP_PROTOCOLTYPE_H #define _SQUID_SRC_ANYP_PROTOCOLTYPE_H -#if HAVE_OSTREAM #include -#endif namespace AnyP { diff --git a/src/anyp/ProtocolVersion.h b/src/anyp/ProtocolVersion.h index 9e246d4b56..8affa67a02 100644 --- a/src/anyp/ProtocolVersion.h +++ b/src/anyp/ProtocolVersion.h @@ -3,9 +3,7 @@ #include "anyp/ProtocolType.h" -#if HAVE_OSTREAM #include -#endif namespace AnyP { diff --git a/src/anyp/UriScheme.h b/src/anyp/UriScheme.h index 98de13c69f..7ba963b4dc 100644 --- a/src/anyp/UriScheme.h +++ b/src/anyp/UriScheme.h @@ -2,9 +2,8 @@ #define SQUID_ANYP_URISCHEME_H #include "anyp/ProtocolType.h" -#if HAVE_IOSFWD + #include -#endif namespace AnyP { diff --git a/src/base/LruMap.h b/src/base/LruMap.h index c558666812..c68a4fe02d 100644 --- a/src/base/LruMap.h +++ b/src/base/LruMap.h @@ -6,12 +6,9 @@ #define SQUID_LRUMAP_H #include "SquidTime.h" -#if HAVE_LIST + #include -#endif -#if HAVE_MAP #include -#endif template class LruMap { diff --git a/src/base/RefCount.h b/src/base/RefCount.h index 26f2a90fef..f0e7b2d8ad 100644 --- a/src/base/RefCount.h +++ b/src/base/RefCount.h @@ -36,9 +36,7 @@ // reference counting requires the Lock API on base classes #include "base/Lock.h" -#if HAVE_IOSTREAM #include -#endif /** * Template for Reference Counting pointers. diff --git a/src/cache_cf.cc b/src/cache_cf.cc index ef28936f65..6e9a4b325a 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -109,12 +109,8 @@ #if HAVE_GLOB_H #include #endif -#if HAVE_LIMITS_H #include -#endif -#if HAVE_LIST #include -#endif #if HAVE_PWD_H #include #endif diff --git a/src/carp.cc b/src/carp.cc index a52527e682..10958250c4 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -41,9 +41,7 @@ #include "Store.h" #include "URL.h" -#if HAVE_MATH_H -#include -#endif +#include #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) diff --git a/src/cbdata.cc b/src/cbdata.cc index d9c8d8353b..ae2827bf1d 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -52,12 +52,10 @@ #include "Store.h" #include "Generic.h" -#if HAVE_LIMITS_H -#include -#endif +#include #if USE_CBDATA_DEBUG -#include #include +#include #endif #if WITH_VALGRIND diff --git a/src/client_side.cc b/src/client_side.cc index 24eb75f5f0..73efdba17f 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -148,15 +148,9 @@ #include "ssl/crtd_message.h" #endif -#if HAVE_LIMITS_H -#include -#endif -#if HAVE_MATH_H -#include -#endif -#if HAVE_LIMITS +#include +#include #include -#endif #if LINGERING_CLOSE #define comm_close comm_lingering_close diff --git a/src/comm.cc b/src/comm.cc index 9f19f1dbb4..48a4dfc64c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -63,6 +63,8 @@ #include "ssl/support.h" #endif +#include +#include #if _SQUID_CYGWIN_ #include #endif @@ -72,12 +74,6 @@ #if HAVE_SYS_UN_H #include #endif -#if HAVE_MATH_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif /* * New C-like simple comm code. This stuff is a mess and doesn't really buy us anything. diff --git a/src/comm/Connection.h b/src/comm/Connection.h index 93581dc7f5..f2f5dc057d 100644 --- a/src/comm/Connection.h +++ b/src/comm/Connection.h @@ -48,12 +48,8 @@ #include "eui/Eui64.h" #endif -#if HAVE_IOSFWD #include -#endif -#if HAVE_OSTREAM #include -#endif class CachePeer; diff --git a/src/comm/ModDevPoll.cc b/src/comm/ModDevPoll.cc index 2a064d3d18..72fc173822 100644 --- a/src/comm/ModDevPoll.cc +++ b/src/comm/ModDevPoll.cc @@ -62,20 +62,16 @@ #include "StatHist.h" #include "Store.h" +#include +#include #if HAVE_SYS_DEVPOLL_H /* Solaris /dev/poll support, see "man -s 7D poll" */ #include #endif -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_LIMITS_H -#include -#endif #define DEBUG_DEVPOLL 0 -// OPEN_MAX is defined in +// OPEN_MAX is defined in #define DEVPOLL_UPDATESIZE OPEN_MAX #define DEVPOLL_QUERYSIZE OPEN_MAX diff --git a/src/comm/Write.cc b/src/comm/Write.cc index bc16767a3a..04bed7cd91 100644 --- a/src/comm/Write.cc +++ b/src/comm/Write.cc @@ -9,13 +9,11 @@ #include "profiler/Profiler.h" #include "SquidTime.h" #include "StatCounters.h" - #if USE_DELAY_POOLS #include "ClientInfo.h" #endif -#if HAVE_ERRNO_H -#include -#endif + +#include void Comm::Write(const Comm::ConnectionPointer &conn, MemBuf *mb, AsyncCall::Pointer &callback) diff --git a/src/esi/Expression.cc b/src/esi/Expression.cc index b0a570fe36..10a7cbed6c 100644 --- a/src/esi/Expression.cc +++ b/src/esi/Expression.cc @@ -36,12 +36,8 @@ #include "esi/Expression.h" #include "profiler/Profiler.h" -#if HAVE_MATH_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif +#include +#include /* stack precedence rules: * before pushing an operator onto the stack, the diff --git a/src/eui/Eui48.h b/src/eui/Eui48.h index c46172cc95..840d39f6f3 100644 --- a/src/eui/Eui48.h +++ b/src/eui/Eui48.h @@ -11,14 +11,7 @@ namespace Ip class Address; }; -#if HAVE_CSTRING #include -#endif - -/* memcpy and friends */ -#if HAVE_STRING_H -#include -#endif namespace Eui { diff --git a/src/eui/Eui64.h b/src/eui/Eui64.h index ec318201d9..4569e83194 100644 --- a/src/eui/Eui64.h +++ b/src/eui/Eui64.h @@ -8,18 +8,11 @@ namespace Ip class Address; } -#if HAVE_CSTRING #include -#endif #if HAVE_SYS_EUI64_H #include #endif -/* memcpy and friends */ -#if HAVE_STRING_H -#include -#endif - namespace Eui { diff --git a/src/event.cc b/src/event.cc index 830299557a..37ad3fe747 100644 --- a/src/event.cc +++ b/src/event.cc @@ -39,9 +39,7 @@ #include "Store.h" #include "tools.h" -#if HAVE_MATH_H -#include -#endif +#include /* The list of event processes */ diff --git a/src/fatal.cc b/src/fatal.cc index e6f3c74106..7b18bf2821 100644 --- a/src/fatal.cc +++ b/src/fatal.cc @@ -34,10 +34,6 @@ #include "SwapDir.h" #include "tools.h" -#if HAVE_STDIO_H -#include -#endif - static void fatal_common(const char *message) { diff --git a/src/fs/ufs/RebuildState.cc b/src/fs/ufs/RebuildState.cc index 3d5072dfa9..8c2ddba3ce 100644 --- a/src/fs/ufs/RebuildState.cc +++ b/src/fs/ufs/RebuildState.cc @@ -42,15 +42,11 @@ #include "tools.h" #include "UFSSwapLogParser.h" -#if HAVE_MATH_H -#include -#endif +#include +#include #if HAVE_SYS_STAT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif CBDATA_NAMESPACED_CLASS_INIT(Fs::Ufs,RebuildState); diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index 3f26df63e6..fdd49f30bd 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -52,15 +52,11 @@ #include "tools.h" #include "UFSSwapDir.h" -#if HAVE_MATH_H -#include -#endif +#include +#include #if HAVE_SYS_STAT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif int Fs::Ufs::UFSSwapDir::NumberOfUFSDirs = 0; int *Fs::Ufs::UFSSwapDir::UFSDirToGlobalDirMapping = NULL; diff --git a/src/fs/ufs/UFSSwapLogParser.h b/src/fs/ufs/UFSSwapLogParser.h index 3163f760dd..b3fa96c3d8 100644 --- a/src/fs/ufs/UFSSwapLogParser.h +++ b/src/fs/ufs/UFSSwapLogParser.h @@ -30,8 +30,6 @@ #ifndef SQUID_FS_UFS_UFSSWAPLOGPARSER_H #define SQUID_FS_UFS_UFSSWAPLOGPARSER_H -#include - class StoreSwapLogData; namespace Fs diff --git a/src/globals.h b/src/globals.h index b4728d01d2..dd601bcbb9 100644 --- a/src/globals.h +++ b/src/globals.h @@ -37,10 +37,6 @@ #include "IoStats.h" #include "rfc2181.h" -#if HAVE_STDIO_H -#include -#endif - extern char *ConfigFile; /* NULL */ extern char *IcpOpcodeStr[]; extern char tmp_error_buf[ERROR_BUF_SZ]; diff --git a/src/icmp/pinger.cc b/src/icmp/pinger.cc index 995a52d870..468c69b17c 100644 --- a/src/icmp/pinger.cc +++ b/src/icmp/pinger.cc @@ -245,12 +245,13 @@ main(int argc, char *argv[]) return 0; } -#else -#include +#else / * !USE_ICMP */ + +#include int main(int argc, char *argv[]) { - fprintf(stderr, "%s: ICMP support not compiled in.\n", argv[0]); + std::cerr << argv[0] << ": ICMP support not compiled in." << std::endl; return 1; } diff --git a/src/int.cc b/src/int.cc index 89df0ecd72..27fbe53a73 100644 --- a/src/int.cc +++ b/src/int.cc @@ -32,9 +32,7 @@ #include "squid.h" -#if HAVE_MATH_H -#include -#endif +#include int isPowTen(int count) diff --git a/src/ip/Address.cc b/src/ip/Address.cc index 774e21431d..1e91ea545d 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -11,12 +11,8 @@ #include "ip/tools.h" #include "util.h" -#if HAVE_ASSERT_H -#include -#endif -#if HAVE_STRING_H -#include -#endif +#include +#include #if HAVE_ARPA_INET_H /* for inet_ntoa() */ #include diff --git a/src/ip/Address.h b/src/ip/Address.h index 680e6e225a..cd9a84a642 100644 --- a/src/ip/Address.h +++ b/src/ip/Address.h @@ -6,6 +6,8 @@ #ifndef _SQUID_SRC_IP_ADDRESS_H #define _SQUID_SRC_IP_ADDRESS_H +#include +#include #if HAVE_SYS_SOCKET_H #include #endif @@ -22,13 +24,6 @@ #include #endif -#if HAVE_IOSFWD -#include -#endif -#if HAVE_OSTREAM -#include -#endif - namespace Ip { diff --git a/src/ip/Intercept.cc b/src/ip/Intercept.cc index 8e00276b64..343916207b 100644 --- a/src/ip/Intercept.cc +++ b/src/ip/Intercept.cc @@ -92,10 +92,8 @@ #endif /* PF_TRANSPARENT required headers */ #if LINUX_NETFILTER -#if HAVE_LIMITS_H -/* must be before including netfilter_ipv4.h */ -#include -#endif +/* must be before including netfilter_ipv4.h */ +#include #include #include #if HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H diff --git a/src/ip/QosConfig.h b/src/ip/QosConfig.h index 6922363fbf..3229595acf 100644 --- a/src/ip/QosConfig.h +++ b/src/ip/QosConfig.h @@ -8,14 +8,10 @@ #if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_H #include #endif - #if HAVE_LIBNETFILTER_CONNTRACK_LIBNETFILTER_CONNTRACK_TCP_H #include #endif - -#if HAVE_LIMITS #include -#endif class fde; diff --git a/src/ip/testAddress.cc b/src/ip/testAddress.cc index e8a69a0f27..eb36a73c79 100644 --- a/src/ip/testAddress.cc +++ b/src/ip/testAddress.cc @@ -1,13 +1,12 @@ #define SQUID_UNIT_TEST 1 #include "squid.h" -//#include "compat/getaddrinfo.h" #include "ip/Address.h" #include "ip/tools.h" #include "testAddress.h" -#if HAVE_CSTRING #include -#endif +#include +#include #if HAVE_NETINET_IN_H #include #endif @@ -17,12 +16,6 @@ #if HAVE_NETDB_H #include #endif -#if HAVE_STRING -#include -#endif -#if HAVE_STDEXCEPT -#include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testIpAddress ); diff --git a/src/ipc/Kid.cc b/src/ipc/Kid.cc index 6b3f79ace9..cd1f77a33d 100644 --- a/src/ipc/Kid.cc +++ b/src/ipc/Kid.cc @@ -7,10 +7,7 @@ #include "globals.h" #include "ipc/Kid.h" -#if HAVE_TIME_H -#include -#endif - +#include #if HAVE_SYS_WAIT_H #include #endif diff --git a/src/ipc/StartListening.h b/src/ipc/StartListening.h index 44055c9948..62310d527d 100644 --- a/src/ipc/StartListening.h +++ b/src/ipc/StartListening.h @@ -12,9 +12,7 @@ #include "ip/forward.h" #include "ipc/FdNotes.h" -#if HAVE_IOSFWD #include -#endif namespace Ipc { diff --git a/src/ipc/TypedMsgHdr.cc b/src/ipc/TypedMsgHdr.cc index fe201b34e5..8e202dae52 100644 --- a/src/ipc/TypedMsgHdr.cc +++ b/src/ipc/TypedMsgHdr.cc @@ -8,7 +8,7 @@ #include "ipc/TypedMsgHdr.h" #include "tools.h" -#include +#include Ipc::TypedMsgHdr::TypedMsgHdr() { diff --git a/src/ipc/mem/Page.cc b/src/ipc/mem/Page.cc index e777c76c7f..2a31e28cba 100644 --- a/src/ipc/mem/Page.cc +++ b/src/ipc/mem/Page.cc @@ -6,9 +6,7 @@ #include "squid.h" #include "ipc/mem/Page.h" -#if HAVE_IOSTREAM #include -#endif std::ostream &Ipc::Mem::operator <<(std::ostream &os, const PageId &page) { diff --git a/src/ipc/mem/Page.h b/src/ipc/mem/Page.h index 0d2d481bb8..590fe3b774 100644 --- a/src/ipc/mem/Page.h +++ b/src/ipc/mem/Page.h @@ -1,12 +1,7 @@ -/* - */ - #ifndef SQUID_IPC_MEM_PAGE_H #define SQUID_IPC_MEM_PAGE_H -#if HAVE_IOSFWD #include -#endif namespace Ipc { diff --git a/src/log/TcpLogger.h b/src/log/TcpLogger.h index 750cd6e89f..3cfcaf57b0 100644 --- a/src/log/TcpLogger.h +++ b/src/log/TcpLogger.h @@ -4,9 +4,7 @@ #include "base/AsyncJob.h" #include "ip/Address.h" -#if HAVE_LIST #include -#endif class MemBlob; typedef RefCount MemBlobPointer; diff --git a/src/mem.cc b/src/mem.cc index 16e6e457be..b43ac7e430 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -51,12 +51,8 @@ #include "Store.h" #include "StoreEntryStream.h" -#if HAVE_IOMANIP #include -#endif -#if HAVE_OSTREAM #include -#endif /* forward declarations */ static void memFree2K(void *); @@ -635,9 +631,7 @@ Mem::PoolReport(const MemPoolStats * mp_st, const MemPoolMeter * AllMeter, std:: MemPoolMeter *pm = mp_st->meter; const char *delim = "\t "; -#if HAVE_IOMANIP stream.setf(std::ios_base::fixed); -#endif stream << std::setw(20) << std::left << mp_st->label << delim; stream << std::setw(4) << std::right << mp_st->obj_size << delim; diff --git a/src/peer_sourcehash.cc b/src/peer_sourcehash.cc index 0213fdbe13..665c8eb25c 100644 --- a/src/peer_sourcehash.cc +++ b/src/peer_sourcehash.cc @@ -40,9 +40,7 @@ #include "SquidConfig.h" #include "Store.h" -#if HAVE_MATH_H -#include -#endif +#include #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) diff --git a/src/peer_userhash.cc b/src/peer_userhash.cc index 7345199a9a..3b043ba0f7 100644 --- a/src/peer_userhash.cc +++ b/src/peer_userhash.cc @@ -45,9 +45,7 @@ #include "SquidConfig.h" #include "Store.h" -#if HAVE_MATH_H -#include -#endif +#include #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) diff --git a/src/recv-announce.cc b/src/recv-announce.cc index f803f881a1..00d1de0329 100644 --- a/src/recv-announce.cc +++ b/src/recv-announce.cc @@ -31,15 +31,14 @@ */ #include "squid.h" -#include +#include +#include #include -#include #include #include #include #include #include -#include #define RECV_BUF_SIZE 8192 diff --git a/src/repl/heap/store_heap_replacement.cc b/src/repl/heap/store_heap_replacement.cc index a9e95da121..3d9dc50b1f 100644 --- a/src/repl/heap/store_heap_replacement.cc +++ b/src/repl/heap/store_heap_replacement.cc @@ -46,9 +46,7 @@ #include "Store.h" #include "store_heap_replacement.h" -#if HAVE_MATH_H -#include -#endif +#include /* * Key generation function to implement the LFU-DA policy (Least diff --git a/src/snmp/Pdu.cc b/src/snmp/Pdu.cc index 2c08fe45f4..2be9cd235f 100644 --- a/src/snmp/Pdu.cc +++ b/src/snmp/Pdu.cc @@ -10,9 +10,8 @@ #include "snmp/Var.h" #include "snmp_core.h" #include "tools.h" -#if HAVE_ALGORITHM + #include -#endif Snmp::Pdu::Pdu() { diff --git a/src/snmp/Var.cc b/src/snmp/Var.cc index 94ecc6997d..9acccbafbf 100644 --- a/src/snmp/Var.cc +++ b/src/snmp/Var.cc @@ -9,9 +9,8 @@ #include "ipc/TypedMsgHdr.h" #include "snmp/Var.h" #include "tools.h" -#if HAVE_ALGORITHM + #include -#endif Snmp::Var::Var() { diff --git a/src/ssl/ErrorDetail.cc b/src/ssl/ErrorDetail.cc index 7fb754f68f..da4196e7d5 100644 --- a/src/ssl/ErrorDetail.cc +++ b/src/ssl/ErrorDetail.cc @@ -1,12 +1,9 @@ #include "squid.h" #include "errorpage.h" #include "ssl/ErrorDetail.h" -#if HAVE_MAP -#include -#endif -#if HAVE_CLIMITS + #include -#endif +#include struct SslErrorEntry { Ssl::ssl_error_t value; diff --git a/src/ssl/ErrorDetailManager.h b/src/ssl/ErrorDetailManager.h index 20a18a2caf..2f2fe28189 100644 --- a/src/ssl/ErrorDetailManager.h +++ b/src/ssl/ErrorDetailManager.h @@ -6,12 +6,8 @@ #include "SquidString.h" #include "ssl/support.h" -#if HAVE_MAP #include -#endif -#if HAVE_STRING #include -#endif class HttpRequest; diff --git a/src/ssl/certificate_db.cc b/src/ssl/certificate_db.cc index f58f84db4c..91d3920ba4 100644 --- a/src/ssl/certificate_db.cc +++ b/src/ssl/certificate_db.cc @@ -1,14 +1,9 @@ #include "squid.h" #include "ssl/certificate_db.h" -#if HAVE_ERRNO_H -#include -#endif -#if HAVE_FSTREAM + +#include #include -#endif -#if HAVE_STDEXCEPT #include -#endif #if HAVE_SYS_STAT_H #include #endif diff --git a/src/ssl/certificate_db.h b/src/ssl/certificate_db.h index 41422fc99d..a4158caf41 100644 --- a/src/ssl/certificate_db.h +++ b/src/ssl/certificate_db.h @@ -2,12 +2,11 @@ #define SQUID_SSL_CERTIFICATE_DB_H #include "ssl/gadgets.h" -#if HAVE_STRING -#include -#endif + #if HAVE_OPENSSL_OPENSSLV_H #include #endif +#include namespace Ssl { diff --git a/src/ssl/context_storage.cc b/src/ssl/context_storage.cc index ac84647e4d..020daf7d44 100644 --- a/src/ssl/context_storage.cc +++ b/src/ssl/context_storage.cc @@ -3,9 +3,8 @@ #include "ssl/context_storage.h" #include "Store.h" #include "StoreEntryStream.h" -#if HAVE_LIMITS + #include -#endif #if USE_SSL #include #endif diff --git a/src/ssl/context_storage.h b/src/ssl/context_storage.h index 52f6da97dd..0ab77378c7 100644 --- a/src/ssl/context_storage.h +++ b/src/ssl/context_storage.h @@ -10,12 +10,9 @@ #include "mgr/Command.h" #include "SquidTime.h" #include "ssl/gadgets.h" -#if HAVE_MAP -#include -#endif -#if HAVE_LIST + #include -#endif +#include #include /// TODO: Replace on real size. diff --git a/src/ssl/crtd_message.cc b/src/ssl/crtd_message.cc index f52db909da..4c5dbe4adb 100644 --- a/src/ssl/crtd_message.cc +++ b/src/ssl/crtd_message.cc @@ -1,15 +1,10 @@ #include "squid.h" #include "ssl/crtd_message.h" #include "ssl/gadgets.h" -#if HAVE_CSTDLIB + #include -#endif -#if HAVE_CSTRING #include -#endif -#if HAVE_STDEXCEPT #include -#endif Ssl::CrtdMessage::CrtdMessage(MessageKind kind) : body_size(0), state(kind == REPLY ? BEFORE_LENGTH: BEFORE_CODE) diff --git a/src/ssl/crtd_message.h b/src/ssl/crtd_message.h index 747bd8e8e9..3c4d1b689b 100644 --- a/src/ssl/crtd_message.h +++ b/src/ssl/crtd_message.h @@ -1,12 +1,8 @@ #ifndef SQUID_SSL_CRTD_MESSAGE_H #define SQUID_SSL_CRTD_MESSAGE_H -#if HAVE_STRING -#include -#endif -#if HAVE_MAP #include -#endif +#include namespace Ssl { diff --git a/src/ssl/gadgets.h b/src/ssl/gadgets.h index e90ca6a0f5..d71475ea4a 100644 --- a/src/ssl/gadgets.h +++ b/src/ssl/gadgets.h @@ -14,9 +14,7 @@ #if HAVE_OPENSSL_TXT_DB_H #include #endif -#if HAVE_STRING #include -#endif namespace Ssl { diff --git a/src/ssl/ssl_crtd.cc b/src/ssl/ssl_crtd.cc index 982faf1575..aeedc321d6 100644 --- a/src/ssl/ssl_crtd.cc +++ b/src/ssl/ssl_crtd.cc @@ -3,21 +3,11 @@ #include "ssl/certificate_db.h" #include "ssl/crtd_message.h" -#if HAVE_CSTRING #include -#endif -#if HAVE_SSTREAM -#include -#endif -#if HAVE_IOSTREAM #include -#endif -#if HAVE_STDEXCEPT +#include #include -#endif -#if HAVE_STRING #include -#endif #if HAVE_GETOPT_H #include #endif diff --git a/src/store.cc b/src/store.cc index c0933b829b..ebea92f716 100644 --- a/src/store.cc +++ b/src/store.cc @@ -69,10 +69,8 @@ #if USE_DELAY_POOLS #include "DelayPools.h" #endif -#if HAVE_LIMITS_H -#include -#endif +#include #include #define REBUILD_TIMESTAMP_DELTA_MAX 2 diff --git a/src/store_digest.cc b/src/store_digest.cc index fd3c647074..a59042ea64 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -56,9 +56,7 @@ #include "Store.h" #include "StoreSearch.h" -#if HAVE_MATH_H -#include -#endif +#include /* * local types diff --git a/src/store_dir.cc b/src/store_dir.cc index a20baa109f..24a0ffdb6b 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -48,6 +48,8 @@ #include "tools.h" #include "Transients.h" +#include +#include #if HAVE_STATVFS #if HAVE_SYS_STATVFS_H #include @@ -57,9 +59,6 @@ #if HAVE_SYS_PARAM_H #include #endif -#if HAVE_LIMITS_H -#include -#endif #if HAVE_SYS_MOUNT_H #include #endif @@ -70,9 +69,6 @@ #if HAVE_SYS_WAIT_H #include #endif -#if HAVE_ERRNO_H -#include -#endif static STDIRSELECT storeDirSelectSwapDirRoundRobin; static STDIRSELECT storeDirSelectSwapDirLeastLoad; diff --git a/src/tests/SBufFindTest.h b/src/tests/SBufFindTest.h index 7756ee4557..7bdacf092d 100644 --- a/src/tests/SBufFindTest.h +++ b/src/tests/SBufFindTest.h @@ -3,10 +3,8 @@ #include "SBuf.h" -#if HAVE_STRING -#include -#endif #include +#include /// Generates and executes a [configurable] large number of SBuf::*find() /// test cases using random strings. Reports detected failures. diff --git a/src/tests/stub_HelperChildConfig.cc b/src/tests/stub_HelperChildConfig.cc index b141f5b43a..d345ff62a8 100644 --- a/src/tests/stub_HelperChildConfig.cc +++ b/src/tests/stub_HelperChildConfig.cc @@ -5,7 +5,7 @@ #define STUB_API "stub_HelperChildconfig.cc" #include "tests/STUB.h" -#include +#include HelperChildConfig::HelperChildConfig(const unsigned int m): n_max(m), diff --git a/src/tests/stub_debug.cc b/src/tests/stub_debug.cc index 4634aba624..44d0836114 100644 --- a/src/tests/stub_debug.cc +++ b/src/tests/stub_debug.cc @@ -8,10 +8,6 @@ #include "squid.h" #include "Debug.h" -#if HAVE_STDIO_H -#include -#endif - FILE *debug_log = NULL; int Debug::TheDepth = 0; diff --git a/src/tests/stub_store_rebuild.cc b/src/tests/stub_store_rebuild.cc index eb6e8b11d5..4e84cb3e90 100644 --- a/src/tests/stub_store_rebuild.cc +++ b/src/tests/stub_store_rebuild.cc @@ -34,9 +34,8 @@ #include "MemBuf.h" #include "store_rebuild.h" #include "SwapDir.h" -#if HAVE_STRING_H -#include -#endif + +#include #define STUB_API "stub_store_rebuild.cc" #include "tests/STUB.h" diff --git a/src/tests/testACLMaxUserIP.cc b/src/tests/testACLMaxUserIP.cc index 542aa5c813..e9e489071b 100644 --- a/src/tests/testACLMaxUserIP.cc +++ b/src/tests/testACLMaxUserIP.cc @@ -1,5 +1,4 @@ #define SQUID_UNIT_TEST 1 - #include "squid.h" #if USE_AUTH @@ -8,9 +7,7 @@ #include "ConfigParser.h" #include "testACLMaxUserIP.h" -#if HAVE_STDEXCEPT #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testACLMaxUserIP ); diff --git a/src/tests/testAuth.cc b/src/tests/testAuth.cc index c7358fefaf..05272830c3 100644 --- a/src/tests/testAuth.cc +++ b/src/tests/testAuth.cc @@ -166,9 +166,7 @@ testAuthConfig::create() } } -#if HAVE_IOSTREAM #include -#endif /* AuthUserRequest::scheme returns the correct scheme for all * authentication types diff --git a/src/tests/testBoilerplate.cc b/src/tests/testBoilerplate.cc index dc9f45ef95..9a4887ddc6 100644 --- a/src/tests/testBoilerplate.cc +++ b/src/tests/testBoilerplate.cc @@ -1,11 +1,9 @@ #define SQUID_UNIT_TEST 1 - #include "squid.h" + #include "testBoilerplate.h" -#if HAVE_STDEXCEPT #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testBoilerplate ); diff --git a/src/tests/testDiskIO.cc b/src/tests/testDiskIO.cc index 2325937201..7e66977d4f 100644 --- a/src/tests/testDiskIO.cc +++ b/src/tests/testDiskIO.cc @@ -1,6 +1,6 @@ #define SQUID_UNIT_TEST 1 - #include "squid.h" + #include "DiskIO/DiskIOModule.h" #include "HttpHeader.h" #include "HttpReply.h" @@ -12,9 +12,7 @@ #include "testDiskIO.h" #include "testStoreSupport.h" -#if HAVE_STDEXCEPT #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testDiskIO ); diff --git a/src/tests/testHttpRequestMethod.cc b/src/tests/testHttpRequestMethod.cc index b90099422d..bb873b830b 100644 --- a/src/tests/testHttpRequestMethod.cc +++ b/src/tests/testHttpRequestMethod.cc @@ -8,9 +8,7 @@ #include "SquidConfig.h" #include "testHttpRequestMethod.h" -#if HAVE_SSTREAM #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testHttpRequestMethod ); diff --git a/src/tests/testRock.cc b/src/tests/testRock.cc index da9b757cd5..c823c5a546 100644 --- a/src/tests/testRock.cc +++ b/src/tests/testRock.cc @@ -18,12 +18,10 @@ #include "testRock.h" #include "testStoreSupport.h" +#include #if HAVE_SYS_STAT_H #include #endif -#if HAVE_STDEXCEPT -#include -#endif #if HAVE_UNISTD_H #include #endif diff --git a/src/tests/testStoreEntryStream.cc b/src/tests/testStoreEntryStream.cc index 2b2a6372ba..7f83f9be68 100644 --- a/src/tests/testStoreEntryStream.cc +++ b/src/tests/testStoreEntryStream.cc @@ -8,10 +8,7 @@ #include "testStore.h" #include "testStoreEntryStream.h" -#if HAVE_IOMANIP #include -#endif - #include CPPUNIT_TEST_SUITE_REGISTRATION( testStoreEntryStream ); diff --git a/src/tests/testURL.cc b/src/tests/testURL.cc index cb6649a359..efa295c3fd 100644 --- a/src/tests/testURL.cc +++ b/src/tests/testURL.cc @@ -7,9 +7,7 @@ #include "testURL.h" #include "URL.h" -#if HAVE_SSTREAM #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testURL ); diff --git a/src/tests/testUfs.cc b/src/tests/testUfs.cc index 84c89fa393..e850076c1e 100644 --- a/src/tests/testUfs.cc +++ b/src/tests/testUfs.cc @@ -15,9 +15,7 @@ #include "testStoreSupport.h" #include "testUfs.h" -#if HAVE_STDEXCEPT #include -#endif #define TESTDIR "testUfs_Store" diff --git a/src/tests/testUriScheme.cc b/src/tests/testUriScheme.cc index 680f0accc2..3877f548ba 100644 --- a/src/tests/testUriScheme.cc +++ b/src/tests/testUriScheme.cc @@ -9,9 +9,7 @@ #include "SquidString.h" #include "tests/testUriScheme.h" -#if HAVE_SSTREAM #include -#endif CPPUNIT_TEST_SUITE_REGISTRATION( testUriScheme ); diff --git a/src/tunnel.cc b/src/tunnel.cc index 3e2257e457..6f9aecd3b4 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -55,12 +55,8 @@ #include "DelayId.h" #endif -#if HAVE_LIMITS_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif +#include +#include /** * TunnelStateData is the state engine performing the tasks for diff --git a/src/ufsdump.cc b/src/ufsdump.cc index b9f0276db9..dc5fedffde 100644 --- a/src/ufsdump.cc +++ b/src/ufsdump.cc @@ -41,15 +41,9 @@ #undef malloc #undef free -#if HAVE_STDEXCEPT -#include -#endif -#if HAVE_IOSTREAM -#include -#endif -#if HAVE_CASSERT #include -#endif +#include +#include /* stub functions for parts of squid not factored to be dynamic yet */ void diff --git a/test-suite/MemPoolTest.cc b/test-suite/MemPoolTest.cc index 1c2ac5a906..7f91c8063b 100644 --- a/test-suite/MemPoolTest.cc +++ b/test-suite/MemPoolTest.cc @@ -36,9 +36,7 @@ #include "MemPool.h" -#if HAVE_IOSTREAM #include -#endif /* TODO: put this in a libTest */ void diff --git a/test-suite/VirtualDeleteOperator.cc b/test-suite/VirtualDeleteOperator.cc index e967d93198..7d9118b68d 100644 --- a/test-suite/VirtualDeleteOperator.cc +++ b/test-suite/VirtualDeleteOperator.cc @@ -33,9 +33,7 @@ #include "squid.h" -#if HAVE_IOSTREAM #include -#endif class CallCounter { diff --git a/test-suite/hash.c b/test-suite/hash.c index c0be0b7f89..3d0531bab7 100644 --- a/test-suite/hash.c +++ b/test-suite/hash.c @@ -35,9 +35,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_CTYPE_H #include #endif diff --git a/test-suite/mem_hdr_test.cc b/test-suite/mem_hdr_test.cc index 4b5bc36738..77272a45fe 100644 --- a/test-suite/mem_hdr_test.cc +++ b/test-suite/mem_hdr_test.cc @@ -38,12 +38,8 @@ #include "mem_node.h" #include "stmem.h" -#if HAVE_IOSTREAM #include -#endif -#if HAVE_SSTREAM #include -#endif /*For a reason required on some platforms */ unsigned int TextException::FileNameHash(const char *fname) diff --git a/test-suite/mem_node_test.cc b/test-suite/mem_node_test.cc index 59f87833c5..7e7daca27b 100644 --- a/test-suite/mem_node_test.cc +++ b/test-suite/mem_node_test.cc @@ -34,9 +34,7 @@ #include "squid.h" #include "mem_node.h" -#if HAVE_IOSTREAM #include -#endif /* TODO: put this in a libTest */ void diff --git a/test-suite/membanger.c b/test-suite/membanger.c index d35410a0ec..ad826bcedc 100644 --- a/test-suite/membanger.c +++ b/test-suite/membanger.c @@ -4,9 +4,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_CTYPE_H #include #endif diff --git a/test-suite/pconn-banger.c b/test-suite/pconn-banger.c index 3551ef1046..556e205413 100644 --- a/test-suite/pconn-banger.c +++ b/test-suite/pconn-banger.c @@ -4,9 +4,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_FCNTL_H #include #endif diff --git a/test-suite/splay.cc b/test-suite/splay.cc index 69b8119a6f..d54cf49585 100644 --- a/test-suite/splay.cc +++ b/test-suite/splay.cc @@ -5,12 +5,7 @@ #include "squid.h" -#if HAVE_STDIO_H -#include -#endif -#if HAVE_STDLIB_H -#include -#endif +#include #if HAVE_UNISTD_H #include #endif diff --git a/test-suite/syntheticoperators.cc b/test-suite/syntheticoperators.cc index f6f06ba783..7986c69e2b 100644 --- a/test-suite/syntheticoperators.cc +++ b/test-suite/syntheticoperators.cc @@ -35,9 +35,7 @@ #include "mem_node.h" #include "stmem.h" -#if HAVE_IOSTREAM #include -#endif class HasExplicit { diff --git a/test-suite/tcp-banger2.c b/test-suite/tcp-banger2.c index c43d50b6b3..54d52decd3 100644 --- a/test-suite/tcp-banger2.c +++ b/test-suite/tcp-banger2.c @@ -34,9 +34,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_FCNTL_H #include #endif diff --git a/test-suite/tcp-banger3.c b/test-suite/tcp-banger3.c index 1fec98e47a..ef5cc411dd 100644 --- a/test-suite/tcp-banger3.c +++ b/test-suite/tcp-banger3.c @@ -34,9 +34,6 @@ #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif #if HAVE_FCNTL_H #include #endif diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 63515a7f9a..d5b998ee3d 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -39,18 +39,14 @@ #include "rfc1738.h" #include "util.h" +#include +#include +#include +#include +#include #if HAVE_UNISTD_H #include #endif -#if HAVE_STDIO_H -#include -#endif -#if HAVE_CTYPE_H -#include -#endif -#if HAVE_ERRNO_H -#include -#endif #if HAVE_FCNTL_H #include #endif @@ -71,12 +67,6 @@ #if HAVE_PWD_H #include #endif -#if HAVE_SIGNAL_H -#include -#endif -#if HAVE_TIME_H -#include -#endif #if HAVE_SYS_PARAM_H #include #endif @@ -101,9 +91,6 @@ #if HAVE_LIBC_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_STRINGS_H #include #endif diff --git a/tools/purge/conffile.cc b/tools/purge/conffile.cc index 69da160da0..7c4116156d 100644 --- a/tools/purge/conffile.cc +++ b/tools/purge/conffile.cc @@ -35,13 +35,13 @@ // // #include "conffile.hh" + +#include +#include +#include +#include #include -#include #include -#include -#include -#include -#include int readConfigFile( CacheDirVector& cachedir, const char* fn, FILE* debug ) diff --git a/tools/purge/conffile.hh b/tools/purge/conffile.hh index a37ae88d4f..f34bf7168b 100644 --- a/tools/purge/conffile.hh +++ b/tools/purge/conffile.hh @@ -52,7 +52,6 @@ typedef int bool; #define DEFAULT_SQUID_CONF "/usr/local/squid/etc/squid.conf" #endif -#include #include struct CacheDir { diff --git a/tools/purge/convert.cc b/tools/purge/convert.cc index 2d0df6fc5f..a2cf4fe378 100644 --- a/tools/purge/convert.cc +++ b/tools/purge/convert.cc @@ -42,12 +42,12 @@ // #include "convert.hh" -#include + +#include +#include #include #include #include -#include -#include #ifndef SA #define SA struct sockaddr diff --git a/tools/purge/copyout.cc b/tools/purge/copyout.cc index a6f00cfb61..a8d62571a7 100644 --- a/tools/purge/copyout.cc +++ b/tools/purge/copyout.cc @@ -38,13 +38,10 @@ #include "squid.h" #include "copyout.hh" -//#include -//#include #include -#include -#include +#include +#include #include -#include #include #include diff --git a/tools/purge/purge.cc b/tools/purge/purge.cc index 558379e1ba..039a906c16 100644 --- a/tools/purge/purge.cc +++ b/tools/purge/purge.cc @@ -93,18 +93,17 @@ #include "squid.h" #include "util.h" -#include -#include +#include +#include +#include +#include +#include +#include #include -#include #include #include #include #include -#include -#include -#include -#include #if HAVE_SIGINFO_H #include diff --git a/tools/purge/signal.cc b/tools/purge/signal.cc index 4f6906c2eb..4672d9265d 100644 --- a/tools/purge/signal.cc +++ b/tools/purge/signal.cc @@ -44,14 +44,11 @@ #include "squid.h" #include "signal.hh" -//#include -#include -#include +#include +#include #include -#include #include #include -//#include SigFunc* Signal( int signo, SigFunc* newhandler, bool doInterrupt ) diff --git a/tools/purge/signal.hh b/tools/purge/signal.hh index 1e021cbfe7..f43557b575 100644 --- a/tools/purge/signal.hh +++ b/tools/purge/signal.hh @@ -50,9 +50,7 @@ #include "squid.h" -#if HAVE_SIGNAL_H -#include -#endif +#include #if !defined(__cplusplus) #ifndef HAVE_BOOL diff --git a/tools/purge/socket.cc b/tools/purge/socket.cc index 5a25997ec5..9450edd891 100644 --- a/tools/purge/socket.cc +++ b/tools/purge/socket.cc @@ -43,13 +43,13 @@ // // #include "socket.hh" + +#include +#include #include #include #include -#include -#include -#include #include #include "convert.hh" diff --git a/tools/purge/squid-tlv.cc b/tools/purge/squid-tlv.cc index 7225f11a53..bf3d41d518 100644 --- a/tools/purge/squid-tlv.cc +++ b/tools/purge/squid-tlv.cc @@ -33,7 +33,6 @@ // // #include "squid.h" -//#include #include "squid-tlv.hh" SquidTLV::SquidTLV( SquidMetaType _type, size_t _size, void* _data ) diff --git a/tools/squidclient/squidclient.cc b/tools/squidclient/squidclient.cc index dfcdbe851c..9a3f43b6d6 100644 --- a/tools/squidclient/squidclient.cc +++ b/tools/squidclient/squidclient.cc @@ -44,28 +44,22 @@ using namespace Squid; /** \endcond */ #endif +#include #include -#include +#include #include - #if _SQUID_WINDOWS_ #include #endif #if HAVE_SYS_SOCKET_H #include #endif -#if HAVE_STRING_H -#include -#endif #if HAVE_UNISTD_H #include #endif #if HAVE_NETDB_H #include #endif -#if HAVE_ERRNO_H -#include -#endif #if HAVE_SYS_STAT_H #include #endif