------------------------------------------------------------ revno: 12607 revision-id: squid3@treenet.co.nz-20130909071719-a40xq1x3ch4xral0 parent: squid3@treenet.co.nz-20130909063054-7b1gdi9tojhyrv6a committer: Amos Jeffries branch nick: 3.3 timestamp: Mon 2013-09-09 01:17:19 -0600 message: Windows: cleanup Squid OS detection macros * _SQUID_WINDOWS_ for any Windows build specific code * _SQUID_CYGWIN_ for CygWin Windows build specific code * _SQUID_MINGW_ for MinGW Windows build specific code ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130909071719-a40xq1x3ch4xral0 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 1db600568fc4bfe1aea8b4696c9a1dbad25bffd7 # timestamp: 2013-09-09 07:19:16 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130909063054-\ # 7b1gdi9tojhyrv6a # # Begin patch === modified file 'compat/getnameinfo.c' --- compat/getnameinfo.c 2013-09-09 06:09:27 +0000 +++ compat/getnameinfo.c 2013-09-09 07:17:19 +0000 @@ -112,7 +112,7 @@ #include #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #undef IN_ADDR #include #endif === modified file 'compat/mswin.cc' --- compat/mswin.cc 2012-09-01 14:38:36 +0000 +++ compat/mswin.cc 2013-09-09 07:17:19 +0000 @@ -37,7 +37,7 @@ /* The following code section is part of an EXPERIMENTAL native */ /* Windows NT/2000 Squid port - Compiles only on MS Visual C++ or MinGW */ -#if _SQUID_MSWIN_ || _SQUID_MINGW_ +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #undef strerror #define sys_nerr _sys_nerr @@ -296,7 +296,7 @@ return &grp; } -#if defined(__MINGW32__) /* MinGW environment */ +#if _SQUID_MINGW_ int _free_osfhnd(int filehandle) { === modified file 'compat/os/mswin.h' --- compat/os/mswin.h 2013-09-09 06:06:59 +0000 +++ compat/os/mswin.h 2013-09-09 07:17:19 +0000 @@ -343,7 +343,7 @@ SQUIDCEXTERN _CRTIMP ioinfo * __pioinfo[]; SQUIDCEXTERN int __cdecl _free_osfhnd(int); -#elif defined(__MINGW32__) /* MinGW environment */ +#elif _SQUID_MINGW_ /* MinGW environment */ __MINGW_IMPORT ioinfo * __pioinfo[]; SQUIDCEXTERN int _free_osfhnd(int); === modified file 'compat/osdetect.h' --- compat/osdetect.h 2012-08-28 13:00:30 +0000 +++ compat/osdetect.h 2013-09-09 07:17:19 +0000 @@ -73,10 +73,6 @@ #define _SQUID_WINDOWS_ 1 #elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) -/* We are using _SQUID_MSWIN_ define in cf.data.pre, so - it must be defined to 1 to avoid the build failure of cfgen. - */ -#define _SQUID_MSWIN_ 1 #define _SQUID_WINDOWS_ 1 #elif defined(__APPLE__) === modified file 'compat/types.h' --- compat/types.h 2012-08-28 13:00:30 +0000 +++ compat/types.h 2013-09-09 07:17:19 +0000 @@ -91,7 +91,7 @@ * "%lx" instead of "%llx" */ #ifndef PRId64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ #define PRId64 "I64d" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRId64 "lld" @@ -101,7 +101,7 @@ #endif #ifndef PRIu64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ #define PRIu64 "I64u" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRIu64 "llu" @@ -111,7 +111,7 @@ #endif #ifndef PRIX64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ #define PRIX64 "I64X" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRIX64 "llX" === modified file 'helpers/basic_auth/LDAP/basic_ldap_auth.cc' --- helpers/basic_auth/LDAP/basic_ldap_auth.cc 2012-07-19 13:49:54 +0000 +++ helpers/basic_auth/LDAP/basic_ldap_auth.cc 2013-09-09 07:17:19 +0000 @@ -93,8 +93,7 @@ #include #include -#if _SQUID_MSWIN_ /* Native Windows port and MinGW */ - +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf #include #include @@ -554,7 +553,7 @@ /* On Windows ldap_start_tls_s is available starting from Windows XP, * so we need to bind at run-time with the function entry point */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (use_tls) { HMODULE WLDAP32Handle; === modified file 'helpers/basic_auth/RADIUS/basic_radius_auth.cc' --- helpers/basic_auth/RADIUS/basic_radius_auth.cc 2012-11-18 11:36:44 +0000 +++ helpers/basic_auth/RADIUS/basic_radius_auth.cc 2013-09-09 07:17:19 +0000 @@ -120,7 +120,7 @@ char progname[] = "basic_radius_auth"; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ void Win32SockCleanup(void) { @@ -532,7 +532,7 @@ fprintf(stderr, "FATAL: %s: Shared secret not specified\n", argv[0]); exit(1); } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ { WSADATA wsaData; WSAStartup(2, &wsaData); === modified file 'helpers/basic_auth/SSPI/valid.h' --- helpers/basic_auth/SSPI/valid.h 2011-07-23 08:37:52 +0000 +++ helpers/basic_auth/SSPI/valid.h 2013-09-09 07:17:19 +0000 @@ -88,7 +88,7 @@ debug(char *format,...) { #ifdef DEBUG -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (debug_enabled) { va_list args; @@ -97,7 +97,7 @@ vfprintf(stderr, format, args); va_end(args); } -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ #endif /* DEBUG */ } #endif /* __GNUC__ */ === modified file 'helpers/digest_auth/LDAP/ldap_backend.cc' --- helpers/digest_auth/LDAP/ldap_backend.cc 2012-11-24 03:38:06 +0000 +++ helpers/digest_auth/LDAP/ldap_backend.cc 2013-09-09 07:17:19 +0000 @@ -12,7 +12,7 @@ #include "ldap_backend.h" -#if _SQUID_MSWIN_ /* Native Windows port and MinGW */ +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf #include @@ -304,7 +304,7 @@ /* On Windows ldap_start_tls_s is available starting from Windows XP, * so we need to bind at run-time with the function entry point */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (use_tls) { HMODULE WLDAP32Handle; === modified file 'helpers/digest_auth/eDirectory/edir_ldapext.cc' --- helpers/digest_auth/eDirectory/edir_ldapext.cc 2012-08-28 13:00:30 +0000 +++ helpers/digest_auth/eDirectory/edir_ldapext.cc 2013-09-09 07:17:19 +0000 @@ -26,7 +26,7 @@ #include "digest_common.h" -#if _SQUID_MSWIN_ /* Native Windows port and MinGW */ +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf #include === modified file 'helpers/digest_auth/eDirectory/ldap_backend.cc' --- helpers/digest_auth/eDirectory/ldap_backend.cc 2012-11-24 01:58:47 +0000 +++ helpers/digest_auth/eDirectory/ldap_backend.cc 2013-09-09 07:17:19 +0000 @@ -11,7 +11,7 @@ #include "ldap_backend.h" -#if _SQUID_MSWIN_ /* Native Windows port and MinGW */ +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf #include @@ -332,7 +332,7 @@ /* On Windows ldap_start_tls_s is available starting from Windows XP, * so we need to bind at run-time with the function entry point */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (use_tls) { HMODULE WLDAP32Handle; === modified file 'helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc' --- helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc 2012-08-28 13:00:30 +0000 +++ helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc 2013-09-09 07:17:19 +0000 @@ -51,7 +51,7 @@ #include #endif -#if _SQUID_MSWIN_ /* Native Windows port and MinGW */ +#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_ #define snprintf _snprintf #include @@ -451,7 +451,7 @@ /* On Windows ldap_start_tls_s is available starting from Windows XP, * so we need to bind at run-time with the function entry point */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (use_tls) { HMODULE WLDAP32Handle; === modified file 'include/squid.h' --- include/squid.h 2012-09-01 14:38:36 +0000 +++ include/squid.h 2013-09-09 07:17:19 +0000 @@ -115,7 +115,7 @@ #define SQUID_MAXPATHLEN 256 // TODO: determine if this is required. OR if compat/os/mswin.h works -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ /** \cond AUTODOCS-IGNORE */ using namespace Squid; /** \endcond */ === modified file 'include/util.h' --- include/util.h 2012-09-01 14:38:36 +0000 +++ include/util.h 2013-09-09 07:17:19 +0000 @@ -111,7 +111,7 @@ /* Windows Port */ /* win32lib.c */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ SQUIDCEXTERN int chroot (const char *); #if !HAVE_GETTIMEOFDAY SQUIDCEXTERN int gettimeofday(struct timeval * ,void *); === modified file 'lib/dirent.c' --- lib/dirent.c 2012-09-01 14:38:36 +0000 +++ lib/dirent.c 2013-09-09 07:17:19 +0000 @@ -49,7 +49,7 @@ #include "squid.h" /* The following code section is part of the native Windows Squid port */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #include "util.h" #include @@ -309,4 +309,4 @@ while ((dirp->dd_stat < lPos) && readdir(dirp)); } } -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ === modified file 'src/DiskIO/AIO/aio_win32.h' --- src/DiskIO/AIO/aio_win32.h 2012-09-01 14:38:36 +0000 +++ src/DiskIO/AIO/aio_win32.h 2013-09-09 07:17:19 +0000 @@ -42,7 +42,7 @@ typedef int64_t off64_t; #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ union sigval { int sival_int; /* integer value */ @@ -104,6 +104,6 @@ int aio_open(const char *, int); void aio_close(int); -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ #endif /* USE_DISKIO_AIO */ #endif /* __WIN32_AIO_H__ */ === modified file 'src/WinSvc.cc' --- src/WinSvc.cc 2012-09-01 10:40:00 +0000 +++ src/WinSvc.cc 2013-09-09 07:17:19 +0000 @@ -35,7 +35,7 @@ #include "protos.h" #include "squid_windows.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #ifndef _MSWSOCK_ #include #endif === modified file 'src/cf.data.pre' --- src/cf.data.pre 2013-07-26 12:21:20 +0000 +++ src/cf.data.pre 2013-09-09 07:17:19 +0000 @@ -8390,7 +8390,7 @@ DOC_END NAME: windows_ipaddrchangemonitor -IFDEF: _SQUID_MSWIN_ +IFDEF: _SQUID_WINDOWS_ COMMENT: on|off TYPE: onoff DEFAULT: on === modified file 'src/cf_gen_defines' --- src/cf_gen_defines 2012-10-28 05:27:14 +0000 +++ src/cf_gen_defines 2013-09-09 07:17:19 +0000 @@ -32,7 +32,7 @@ define["USE_WCCP"]="--enable-wccp" define["USE_WCCPv2"]="--enable-wccpv2" define["USE_QOS_TOS"]="--enable-zph-qos" - define["_SQUID_MSWIN_"]="MS Windows" + define["_SQUID_WINDOWS_"]="MS Windows" define["SO_MARK&&USE_LIBCAP"]="Packet MARK (Linux)" } /^IFDEF:/ { === modified file 'src/comm.cc' --- src/comm.cc 2013-04-02 04:07:35 +0000 +++ src/comm.cc 2013-09-09 07:17:19 +0000 @@ -670,7 +670,7 @@ commSetReuseAddr(new_socket); if (addr.GetPort() > (unsigned short) 0) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (sock_type != SOCK_DGRAM) #endif commSetNoLinger(new_socket); @@ -729,7 +729,7 @@ fd_table[conn->fd].flags.close_on_exec = 1; if (conn->local.GetPort() > (unsigned short) 0) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (AI->ai_socktype != SOCK_DGRAM) #endif fd_table[conn->fd].flags.nolinger = 1; @@ -1330,7 +1330,7 @@ int commSetNonBlocking(int fd) { -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ int flags; int dummy = 0; #endif @@ -1350,7 +1350,7 @@ } else { #endif #endif -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) { debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror()); @@ -1374,7 +1374,7 @@ int commUnsetNonBlocking(int fd) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int nonblocking = FALSE; if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) { === modified file 'src/comm/Loops.h' --- src/comm/Loops.h 2012-09-21 14:57:30 +0000 +++ src/comm/Loops.h 2013-09-09 07:17:19 +0000 @@ -36,7 +36,7 @@ * This is a per-port limit for ICP/HTCP ports. * DNS has a separate limit. */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #define INCOMING_UDP_MAX 1 #else #define INCOMING_UDP_MAX 15 @@ -45,7 +45,7 @@ /** * Max number of DNS messages to receive per call to DNS read handler */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #define INCOMING_DNS_MAX 1 #else #define INCOMING_DNS_MAX 15 @@ -55,7 +55,7 @@ * Max number of new TCP connections to accept per call to the TCP listener poller. * This is a per-port limit for HTTP/HTTPS ports. */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #define INCOMING_TCP_MAX 1 #else #define INCOMING_TCP_MAX 10 === modified file 'src/debug.cc' --- src/debug.cc 2012-10-03 17:32:57 +0000 +++ src/debug.cc 2013-09-09 07:17:19 +0000 @@ -62,7 +62,7 @@ static void _db_print_stderr(const char *format, va_list args); static void _db_print_file(const char *format, va_list args); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ extern LPCRITICAL_SECTION dbg_mutex; typedef BOOL (WINAPI * PFInitializeCriticalSectionAndSpinCount) (LPCRITICAL_SECTION, DWORD); #endif @@ -76,7 +76,7 @@ va_list args2; va_list args3; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ /* Multiple WIN32 threads may call this simultaneously */ if (!dbg_mutex) { @@ -129,7 +129,7 @@ _db_print_syslog(format, args3); #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ LeaveCriticalSection(dbg_mutex); #endif @@ -485,7 +485,7 @@ --i; snprintf(from, MAXPATHLEN, "%s.%d", debug_log_file, i - 1); snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, i); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ remove (to); #endif @@ -496,14 +496,14 @@ * You can't rename open files on Microsoft "operating systems" * so we close before renaming. */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (debug_log != stderr) fclose(debug_log); #endif /* Rotate the current log to .0 */ if (Debug::rotateNumber > 0) { snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, 0); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ remove (to); #endif === modified file 'src/dns_internal.cc' --- src/dns_internal.cc 2013-07-10 12:44:19 +0000 +++ src/dns_internal.cc 2013-09-09 07:17:19 +0000 @@ -236,7 +236,7 @@ static void idnsFreeNameservers(void); static void idnsFreeSearchpath(void); static void idnsParseNameservers(void); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ static void idnsParseResolvConf(void); #endif #if _SQUID_WINDOWS_ @@ -366,7 +366,7 @@ } } -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ static void idnsParseResolvConf(void) { @@ -1535,7 +1535,7 @@ assert(0 == nns); idnsParseNameservers(); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ if (0 == nns) idnsParseResolvConf(); === modified file 'src/dnsserver.cc' --- src/dnsserver.cc 2012-08-28 13:00:30 +0000 +++ src/dnsserver.cc 2013-09-09 07:17:19 +0000 @@ -497,7 +497,7 @@ } } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ { WSADATA wsaData; @@ -511,7 +511,7 @@ memset(request, '\0', REQ_SZ); if (fgets(request, REQ_SZ, stdin) == NULL) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ WSACleanup(); #endif exit(1); === modified file 'src/fd.cc' --- src/fd.cc 2012-09-01 14:38:36 +0000 +++ src/fd.cc 2013-09-09 07:17:19 +0000 @@ -49,7 +49,7 @@ int default_read_method(int, char *, int); int default_write_method(int, const char *, int); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int socket_read_method(int, char *, int); int socket_write_method(int, const char *, int); int file_read_method(int, char *, int); @@ -122,7 +122,7 @@ *F = fde(); } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int socket_read_method(int fd, char *buf, int len) @@ -222,7 +222,7 @@ F->type = type; F->flags.open = 1; F->epoll_state = 0; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ F->win32.handle = _get_osfhandle(fd); === modified file 'src/fde.cc' --- src/fde.cc 2013-02-26 22:21:22 +0000 +++ src/fde.cc 2013-09-09 07:17:19 +0000 @@ -55,7 +55,7 @@ if (!flags.open) return; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ storeAppendPrintf(&dumpEntry, "%4d 0x%-8lX %-6.6s %4d %7" PRId64 "%c %7" PRId64 "%c %-21s %s\n", fdNumber, @@ -79,7 +79,7 @@ { int i; storeAppendPrintf(dumpEntry, "Active file descriptors:\n"); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ storeAppendPrintf(dumpEntry, "%-4s %-10s %-6s %-4s %-7s* %-7s* %-21s %s\n", "File", @@ -94,7 +94,7 @@ "Nwrite", "Remote Address", "Description"); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ storeAppendPrintf(dumpEntry, "---- ---------- ------ ---- -------- -------- --------------------- ------------------------------\n"); #else storeAppendPrintf(dumpEntry, "---- ------ ---- -------- -------- --------------------- ------------------------------\n"); === modified file 'src/fde.h' --- src/fde.h 2013-02-26 22:21:22 +0000 +++ src/fde.h 2013-09-09 07:17:19 +0000 @@ -136,7 +136,7 @@ SSL *ssl; SSL_CTX *dynamicSslContext; ///< cached and then freed when fd is closed #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ struct { long handle; } win32; @@ -189,7 +189,7 @@ ssl = NULL; dynamicSslContext = NULL; #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ win32.handle = NULL; #endif tosFromServer = '\0'; === modified file 'src/globals.h' --- src/globals.h 2013-02-26 22:21:22 +0000 +++ src/globals.h 2013-09-09 07:17:19 +0000 @@ -113,7 +113,7 @@ extern int64_t store_maxobjsize; /* -1 */ extern hash_table *proxy_auth_username_cache; /* NULL */ extern int incoming_sockets_accepted; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ extern unsigned int WIN32_Socks_initialized; /* 0 */ #endif #if _SQUID_WINDOWS_ === modified file 'src/helper.cc' --- src/helper.cc 2013-05-19 02:32:10 +0000 +++ src/helper.cc 2013-09-09 07:17:19 +0000 @@ -97,7 +97,7 @@ void HelperServerBase::closePipesSafely() { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int no = index + 1; shutdown(writePipe->fd, SD_BOTH); @@ -110,7 +110,7 @@ readPipe->close(); writePipe->close(); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (hIpc) { if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) { getCurrentTime(); @@ -126,7 +126,7 @@ void HelperServerBase::closeWritePipeSafely() { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int no = index + 1; shutdown(writePipe->fd, (readPipe->fd == writePipe->fd ? SD_BOTH : SD_SEND)); @@ -137,7 +137,7 @@ readPipe->fd = -1; writePipe->close(); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (hIpc) { if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) { getCurrentTime(); === modified file 'src/icmp/Icmp4.h' --- src/icmp/Icmp4.h 2012-10-03 17:32:57 +0000 +++ src/icmp/Icmp4.h 2013-09-09 07:17:19 +0000 @@ -83,7 +83,7 @@ #if _SQUID_WINDOWS_ #include "fde.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_WINSOCK2_H #include @@ -123,7 +123,7 @@ uint32_t timestamp; /* not part of ICMP, but we need it */ } icmphdr; -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ #ifndef ICMP_ECHO #define ICMP_ECHO 8 === modified file 'src/icmp/IcmpPinger.cc' --- src/icmp/IcmpPinger.cc 2012-09-01 14:38:36 +0000 +++ src/icmp/IcmpPinger.cc 2013-09-09 07:17:19 +0000 @@ -58,7 +58,7 @@ Close(); } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ void Win32SockCleanup(void) { @@ -70,7 +70,7 @@ int IcmpPinger::Open(void) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ WSADATA wsaData; WSAPROTOCOL_INFO wpi; @@ -152,7 +152,7 @@ return icmp_sock; -#else /* !_SQUID_MSWIN_ */ +#else /* !_SQUID_WINDOWS_ */ /* non-windows apps use stdin/out pipes as the squid channel(s) */ socket_from_squid = 0; // use STDIN macro ?? @@ -164,7 +164,7 @@ void IcmpPinger::Close(void) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ shutdown(icmp_sock, SD_BOTH); close(icmp_sock); === modified file 'src/icmp/IcmpSquid.cc' --- src/icmp/IcmpSquid.cc 2012-09-04 09:10:20 +0000 +++ src/icmp/IcmpSquid.cc 2013-09-09 07:17:19 +0000 @@ -263,11 +263,11 @@ if (localhost.SetIPv4()) SendEcho(localhost, S_ICMP_ECHO, "localhost"); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ debugs(37, 4, HERE << "Pinger handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid); -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ return icmp_sock; #else /* USE_ICMP */ return -1; @@ -284,7 +284,7 @@ debugs(37, DBG_IMPORTANT, HERE << "Closing Pinger socket on FD " << icmp_sock); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ send(icmp_sock, (const void *) "$shutdown\n", 10, 0); @@ -292,7 +292,7 @@ comm_close(icmp_sock); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (hIpc) { if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) { === modified file 'src/icmp/pinger.cc' --- src/icmp/pinger.cc 2013-02-01 04:46:16 +0000 +++ src/icmp/pinger.cc 2013-09-09 07:17:19 +0000 @@ -72,7 +72,7 @@ #include "IcmpPinger.h" #include "ip/tools.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_WINSOCK2_H #include @@ -106,7 +106,7 @@ /* non-windows use STDOUT for feedback to squid */ #define LINK_TO_SQUID 1 -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ // ICMP Engines are declared global here so they can call each other easily. IcmpPinger control; === modified file 'src/ip/Address.h' --- src/ip/Address.h 2012-10-04 09:14:06 +0000 +++ src/ip/Address.h 2013-09-09 07:17:19 +0000 @@ -45,7 +45,7 @@ #if HAVE_NETINET_IP_H #include #endif -#if _SQUID_MSWIN_ +#if HAVE_WS2TCPIP_H #include #endif #if HAVE_NETDB_H === modified file 'src/main.cc' --- src/main.cc 2013-02-08 11:25:14 +0000 +++ src/main.cc 2013-09-09 07:17:19 +0000 @@ -203,7 +203,7 @@ static void mainSetCwd(void); static int checkRunningPid(void); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ static const char *squid_start_script = "squid_start"; #endif @@ -619,7 +619,7 @@ { do_rotate = 1; RotateSignal = sig; -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ #if !HAVE_SIGACTION signal(sig, rotate_logs); @@ -633,7 +633,7 @@ { do_reconfigure = 1; ReconfigureSignal = sig; -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ #if !HAVE_SIGACTION signal(sig, reconfigure); @@ -662,7 +662,7 @@ " pid " << ppid << ": " << xstrerror()); } -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ #if KILL_PARENT_OPT if (!IamMasterProcess() && ppid > 1) { @@ -1020,7 +1020,7 @@ setSystemLimits(); debugs(1, DBG_IMPORTANT, "With " << Squid_MaxFD << " file descriptors available"); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ debugs(1, DBG_IMPORTANT, "With " << _getmaxstdio() << " CRT stdio descriptors available"); @@ -1577,7 +1577,7 @@ exit(0); } -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ /* * This function is run when Squid is in daemon mode, just * before the parent forks and starts up the child process. @@ -1620,7 +1620,7 @@ } } -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ static int checkRunningPid(void) @@ -1650,7 +1650,7 @@ static void watch_child(char *argv[]) { -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ char *prog; #if _SQUID_NEXT_ @@ -1819,7 +1819,7 @@ } /* NOTREACHED */ -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ } === modified file 'src/ssl/certificate_db.cc' --- src/ssl/certificate_db.cc 2013-07-05 03:06:00 +0000 +++ src/ssl/certificate_db.cc 2013-09-09 07:17:19 +0000 @@ -23,7 +23,7 @@ Ssl::Lock::Lock(std::string const &aFilename) : filename(aFilename), -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ hFile(INVALID_HANDLE_VALUE) #else fd(-1) @@ -33,7 +33,7 @@ bool Ssl::Lock::locked() const { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ return hFile != INVALID_HANDLE_VALUE; #else return fd != -1; @@ -43,7 +43,7 @@ void Ssl::Lock::lock() { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ hFile = CreateFile(TEXT(filename.c_str()), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) #else @@ -52,7 +52,7 @@ #endif throw std::runtime_error("Failed to open file " + filename); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (!LockFile(hFile, 0, 0, 1, 0)) #else if (flock(fd, LOCK_EX) != 0) @@ -62,7 +62,7 @@ void Ssl::Lock::unlock() { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (hFile != INVALID_HANDLE_VALUE) { UnlockFile(hFile, 0, 0, 1, 0); CloseHandle(hFile); === modified file 'src/ssl/certificate_db.h' --- src/ssl/certificate_db.h 2013-05-19 03:12:36 +0000 +++ src/ssl/certificate_db.h 2013-09-09 07:17:19 +0000 @@ -23,7 +23,7 @@ const char *name() const { return filename.c_str(); } private: std::string filename; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ HANDLE hFile; ///< Windows file handle. #else int fd; ///< Linux file descriptor. === modified file 'src/ssl/support.h' --- src/ssl/support.h 2012-09-09 17:13:42 +0000 +++ src/ssl/support.h 2013-09-09 07:17:19 +0000 @@ -244,7 +244,7 @@ bool setClientSNI(SSL *ssl, const char *fqdn); } //namespace Ssl -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if defined(__cplusplus) @@ -272,6 +272,6 @@ #endif /* __cplusplus */ -#endif /* _SQUID_MSWIN_ */ +#endif /* _SQUID_WINDOWS_ */ #endif /* SQUID_SSL_SUPPORT_H */ === modified file 'src/store_dir.cc' --- src/store_dir.cc 2013-04-27 02:23:20 +0000 +++ src/store_dir.cc 2013-09-09 07:17:19 +0000 @@ -127,7 +127,7 @@ * The following is a workaround for create store directories sequentially * when running on native Windows port. */ -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ if (fork()) return; @@ -136,7 +136,7 @@ aStore.create(); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ exit(0); @@ -148,7 +148,7 @@ { swapDir->create(); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ pid_t pid; === modified file 'src/tools.cc' --- src/tools.cc 2013-02-14 09:12:21 +0000 +++ src/tools.cc 2013-09-09 07:17:19 +0000 @@ -366,7 +366,7 @@ #endif #endif /* PRINT_STACK_TRACE */ -#if SA_RESETHAND == 0 && !_SQUID_MSWIN_ +#if SA_RESETHAND == 0 && !_SQUID_WINDOWS_ signal(SIGSEGV, SIG_DFL); signal(SIGBUS, SIG_DFL); @@ -454,7 +454,7 @@ void sig_child(int sig) { -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ #if _SQUID_NEXT_ union wait status; #else @@ -994,7 +994,7 @@ debugs(50, DBG_CRITICAL, "sigaction: sig=" << sig << " func=" << func << ": " << xstrerror()); #else -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ /* On Windows, only SIGINT, SIGILL, SIGFPE, SIGTERM, SIGBREAK, SIGABRT and SIGSEGV signals are supported, so we must care of don't call signal() for other value. === modified file 'src/unlinkd.cc' --- src/unlinkd.cc 2012-08-31 16:57:39 +0000 +++ src/unlinkd.cc 2013-09-09 07:17:19 +0000 @@ -149,7 +149,7 @@ void unlinkdClose(void) -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ { if (unlinkd_wfd > -1) { @@ -224,7 +224,7 @@ #if USE_POLL && _SQUID_OSF_ /* pipes and poll() don't get along on DUNIX -DW */ IPC_STREAM, -#elif _SQUID_MSWIN_ +#elif _SQUID_WINDOWS_ /* select() will fail on a pipe */ IPC_TCP_SOCKET, #else @@ -265,7 +265,7 @@ debugs(2, DBG_IMPORTANT, "Unlinkd pipe opened on FD " << unlinkd_wfd); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ debugs(2, 4, "Unlinkd handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid); === modified file 'src/win32.cc' --- src/win32.cc 2012-09-01 14:24:50 +0000 +++ src/win32.cc 2013-09-09 07:17:19 +0000 @@ -35,7 +35,7 @@ #include "squid_windows.h" #include "win32.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_WIN32_PSAPI #include #endif === modified file 'src/win32.h' --- src/win32.h 2012-09-22 10:56:48 +0000 +++ src/win32.h 2013-09-09 07:17:19 +0000 @@ -33,7 +33,7 @@ * */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_SYS_TIME_H #include === modified file 'tools/cachemgr.cc' --- tools/cachemgr.cc 2013-01-08 22:39:52 +0000 +++ tools/cachemgr.cc 2013-09-09 07:17:19 +0000 @@ -164,7 +164,7 @@ static int check_target_acl(const char *hostname, int port); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ static int s_iInitCount = 0; int Win32SockInit(void) @@ -610,7 +610,7 @@ read_reply(int s, cachemgr_request * req) { char buf[4 * 1024]; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ int reply; char *tmpfile = tempnam(NULL, "tmp0000"); @@ -634,7 +634,7 @@ parse_menu = 1; if (fp == NULL) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ perror(tmpfile); xfree(tmpfile); #else @@ -646,7 +646,7 @@ return 1; } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ while ((reply=recv(s, buf , sizeof(buf), 0)) > 0) fwrite(buf, 1, reply, fp); @@ -785,7 +785,7 @@ } fclose(fp); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ remove(tmpfile); xfree(tmpfile); @@ -902,7 +902,7 @@ cachemgr_request *req; now = time(NULL); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ Win32SockInit(); atexit(Win32SockCleanup); @@ -1027,7 +1027,7 @@ else return NULL; -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (strlen(buf) == 0 || strlen(buf) == 4000) #else