]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: cleanup Squid OS detection macros
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 8 Oct 2012 05:21:11 +0000 (23:21 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 8 Oct 2012 05:21:11 +0000 (23:21 -0600)
* _SQUID_WINDOWS_  for any Windows build specific code
* _SQUID_CYGWIN_   for CygWin Windows build specific code
* _SQUID_MINGW_    for MinGW Windows build specific code

46 files changed:
compat/getnameinfo.c
compat/mswin.cc
compat/osdetect.h
compat/types.h
configure.ac
helpers/basic_auth/LDAP/basic_ldap_auth.cc
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/SSPI/valid.h
helpers/digest_auth/LDAP/ldap_backend.cc
helpers/digest_auth/eDirectory/edir_ldapext.cc
helpers/digest_auth/eDirectory/ldap_backend.cc
helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc
include/squid.h
include/util.h
lib/dirent.c
src/DiskIO/AIO/aio_win32.h
src/WinSvc.cc
src/cf.data.pre
src/cf_gen_defines
src/comm.cc
src/comm/Loops.h
src/debug.cc
src/dns_internal.cc
src/dnsserver.cc
src/fd.cc
src/fde.cc
src/fde.h
src/fs/coss/store_dir_coss.cc
src/fs/ufs/UFSSwapDir.cc
src/globals.h
src/helper.cc
src/icmp/Icmp4.h
src/icmp/IcmpPinger.cc
src/icmp/IcmpSquid.cc
src/icmp/pinger.cc
src/ip/Address.h
src/main.cc
src/ssl/certificate_db.cc
src/ssl/certificate_db.h
src/ssl/support.h
src/store_dir.cc
src/tools.cc
src/unlinkd.cc
src/win32.cc
src/win32.h
tools/cachemgr.cc

index 76c6ec28e1ffa2f26f0dad7c85c4ece101d54aea..194fd03277c03a5175db82ba1a694d00c6f0a540 100644 (file)
 #include <inttypes.h>
 #endif
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #undef IN_ADDR
 #include <ws2tcpip.h>
 #endif
index baa8a88715df11d63873ff772a84c461a8b27499..03fa66ec2d15a014eecb001ebf851e576fcdef90 100644 (file)
@@ -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
index 4b98346432940c5072ff1bed9f740bbff3147ed2..d3fbce0cf7fafe370774ff5b0fbcac3fbf597338 100644 (file)
 #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__)
index 59a32cbe630a43c257970e9fb9fc42da18ae4510..20e265a1d5f6af95decfb774951405325edea3c8 100644 (file)
@@ -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"
 #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"
 #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"
index 4b915e107cc96f79abb4a08aa63912bfba94326c..7f1c2cdd20baa66d8c3fa316b92418547889e16c 100644 (file)
@@ -2405,7 +2405,8 @@ AC_CHECK_HEADERS( \
   inttypes.h \
   db.h \
   db_185.h \
-  wchar.h
+  wchar.h \
+  ws2tcpip.h
 )
 
 CHECK_STRUCT_PAM_CONV
index aef28f58342cde3787e459d3fa4b2ff99d33a50d..c580df076c0aca9b35655b6fa75e5b3adcaaa801 100644 (file)
@@ -93,8 +93,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
-
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
 #define snprintf _snprintf
 #include <windows.h>
 #include <winldap.h>
@@ -554,7 +553,7 @@ main(int argc, char **argv)
     /* 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;
index 3efa8b0562af05415fa3700b1080d9c02c582426..73e2304f710af710728b101ff7178d32593d534a 100644 (file)
@@ -120,7 +120,7 @@ static int retries = 10;
 
 char progname[] = "basic_radius_auth";
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 void
 Win32SockCleanup(void)
 {
@@ -522,7 +522,7 @@ main(int argc, char **argv)
         fprintf(stderr, "FATAL: %s: Shared secret not specified\n", argv[0]);
         exit(1);
     }
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     {
         WSADATA wsaData;
         WSAStartup(2, &wsaData);
index c6113b66e7c99a4fce12f2ac4f6f6779b06b5032..86339e8e0cebfd3e8f69f7e3d0b451ed7cf3bc30 100644 (file)
@@ -88,7 +88,7 @@ static void
 debug(char *format,...)
 {
 #ifdef DEBUG
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     if (debug_enabled) {
         va_list args;
 
@@ -97,7 +97,7 @@ debug(char *format,...)
         vfprintf(stderr, format, args);
         va_end(args);
     }
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
 #endif /* DEBUG */
 }
 #endif /* __GNUC__ */
index f7d9244e0082fdcfa6b040e67910376bc60c4355..46409866efe861ee429f5b64dc395ad6d3e42271 100644 (file)
@@ -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 <windows.h>
@@ -303,7 +303,7 @@ ldapconnect(void)
     /* 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;
index 812b4e82bb874fd5918f26670fb560f79f5a8e44..f0f362254d58a4ff2168aeb81c17a9bd7567b311 100644 (file)
@@ -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 <windows.h>
index 814a5df0238115de05b4178026fc143e1c61192c..e7deefc258717a194a5da085d9f59fa9be1cc4f4 100644 (file)
@@ -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 <windows.h>
@@ -331,7 +331,7 @@ ldapconnect(void)
     /* 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;
index 48d869169672f55496d2e1ac840bd7e22e7e7815..30394da72940a784efe6cd32e82515d5857a3468 100644 (file)
@@ -51,7 +51,7 @@
 #include <ctype.h>
 #endif
 
-#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
+#if _SQUID_WINDOWS_ && !_SQUID_CYGWIN_
 
 #define snprintf _snprintf
 #include <windows.h>
@@ -451,7 +451,7 @@ main(int argc, char **argv)
     /* 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;
index 8db5c118fc40429abf1e3b3d1e9b816232c82e05..b844bddf18537eb3b055bc8e2d449558e7934488 100644 (file)
 #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 */
index 69be2b209d0c6d5816f5d51804adb4fe586e0047..b3b60b7f23581f0063ca866c8d6081305997eecc 100644 (file)
@@ -111,7 +111,7 @@ SQUIDCEXTERN unsigned int RoundTo(const unsigned int num, const unsigned int wha
 
 /* Windows Port */
 /* win32lib.c */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 SQUIDCEXTERN int chroot (const char *);
 #if !HAVE_GETTIMEOFDAY
 SQUIDCEXTERN int gettimeofday(struct timeval * ,void *);
index 898240344eb54f10a28c15074f2f6be1930bb139..83d82aa6d2e522afa83151b70e156d20a7e96ad3 100644 (file)
@@ -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 <stdlib.h>
@@ -309,4 +309,4 @@ seekdir(DIR * dirp, long lPos)
         while ((dirp->dd_stat < lPos) && readdir(dirp));
     }
 }
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
index 9596209bc1bc3fe20014b3dc4624631532362cbe..fb05246277e60e81843e93945cf00720356fc772 100644 (file)
@@ -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_error64(const struct aiocb64 *);
 int aio_open(const char *, int);
 void aio_close(int);
 
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
 #endif /* USE_DISKIO_AIO */
 #endif /* __WIN32_AIO_H__ */
index 9f8ba5a56e1a16b09e4ab9cf65d8c46e3570a7ac..cac66d5d183eba9f862240ecd778ca3b3c063590 100644 (file)
@@ -35,7 +35,7 @@
 #include "protos.h"
 #include "squid_windows.h"
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #ifndef _MSWSOCK_
 #include <mswsock.h>
 #endif
index f640b8d943678e831615c1070bc3abfa7fadf14f..c2f154bea96314b63c6fc4d7413020f1adb310d9 100644 (file)
@@ -8080,7 +8080,7 @@ DOC_START
 DOC_END
 
 NAME: windows_ipaddrchangemonitor
-IFDEF: _SQUID_MSWIN_
+IFDEF: _SQUID_WINDOWS_
 COMMENT: on|off
 TYPE: onoff
 DEFAULT: on
index c430bbb1b951cd98f973b34810b8a77eaada015d..1fd4ab9ca0659eec550df3e720301e08408c11b6 100644 (file)
@@ -29,7 +29,7 @@ BEGIN {
        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:/ {
index c5a1ed7010a79310886f05d559f1e63a4644d938..ee637854365a53d85baf5495be02d66ebd064f1d 100644 (file)
@@ -655,7 +655,7 @@ comm_apply_flags(int new_socket,
         commSetReuseAddr(new_socket);
 
     if (addr.GetPort() > (unsigned short) 0) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
         if (sock_type != SOCK_DGRAM)
 #endif
             commSetNoLinger(new_socket);
@@ -714,7 +714,7 @@ comm_import_opened(const Comm::ConnectionPointer &conn,
         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;
@@ -1315,7 +1315,7 @@ commSetTcpRcvbuf(int fd, int size)
 int
 commSetNonBlocking(int fd)
 {
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
     int flags;
     int dummy = 0;
 #endif
@@ -1335,7 +1335,7 @@ commSetNonBlocking(int fd)
     } 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());
@@ -1359,7 +1359,7 @@ commSetNonBlocking(int fd)
 int
 commUnsetNonBlocking(int fd)
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     int nonblocking = FALSE;
 
     if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) {
index d587da9392337ab54ea11e7be86fc851d541bb75..56f064037b001736d90ede0f4642176c28341bdd 100644 (file)
@@ -36,7 +36,7 @@ void QuickPollRequired(void);
  * 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 @@ void QuickPollRequired(void);
 /**
  * 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 @@ void QuickPollRequired(void);
  * 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
index 590587b7765f08ab465531fd1f36747e609c4127..7a639ef567b69d54fffa2c17c05960a7afe68178 100644 (file)
@@ -62,7 +62,7 @@ static void _db_print_syslog(const char *format, va_list args);
 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 @@ _db_print(const char *format,...)
     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(const char *format,...)
     _db_print_syslog(format, args3);
 #endif
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     LeaveCriticalSection(dbg_mutex);
 #endif
 
@@ -485,7 +485,7 @@ _db_rotate_log(void)
         --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 @@ _db_rotate_log(void)
      * 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
index 27578b0dafc80d12399367e966460b358d898495..7af69c14555cbde97b8c956ee40069fc0ae80b63 100644 (file)
@@ -236,7 +236,7 @@ static void idnsAddPathComponent(const char *buf);
 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_
@@ -365,7 +365,7 @@ idnsParseNameservers(void)
     }
 }
 
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 static void
 idnsParseResolvConf(void)
 {
@@ -1534,7 +1534,7 @@ dnsInit(void)
 
     assert(0 == nns);
     idnsParseNameservers();
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 
     if (0 == nns)
         idnsParseResolvConf();
index 17630da24fbfdeec777ae5c347760d3b93b7f341..d15a37332f3534429cef8cf6efab23cf98db8764 100644 (file)
@@ -497,7 +497,7 @@ main(int argc, char *argv[])
         }
     }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     {
         WSADATA wsaData;
 
@@ -511,7 +511,7 @@ main(int argc, char *argv[])
         memset(request, '\0', REQ_SZ);
 
         if (fgets(request, REQ_SZ, stdin) == NULL) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
             WSACleanup();
 #endif
             exit(1);
index 4655fe47f5084d2fdae6e9ddd11b7596cb89a5c7..2dca81d55e892859cc2f7a9258f79a74f3e8d226 100644 (file)
--- a/src/fd.cc
+++ b/src/fd.cc
@@ -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 @@ fd_close(int fd)
     *F = fde();
 }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 int
 socket_read_method(int fd, char *buf, int len)
@@ -222,7 +222,7 @@ fd_open(int fd, unsigned int type, const char *desc)
     F->type = type;
     F->flags.open = 1;
     F->epoll_state = 0;
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     F->win32.handle = _get_osfhandle(fd);
 
index 8aae9767f5148774f7ae54ca19897865134fc46f..2eef778abb4bd1af6d353207a15d1b3afe9fe419 100644 (file)
@@ -53,7 +53,7 @@ fde::dumpStats (StoreEntry &dumpEntry, int fdNumber)
     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,
@@ -77,7 +77,7 @@ fde::DumpStats (StoreEntry *dumpEntry)
 {
     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",
@@ -92,7 +92,7 @@ fde::DumpStats (StoreEntry *dumpEntry)
                       "Nwrite",
                       "Remote Address",
                       "Description");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     storeAppendPrintf(dumpEntry, "---- ---------- ------ ---- -------- -------- --------------------- ------------------------------\n");
 #else
     storeAppendPrintf(dumpEntry, "---- ------ ---- -------- -------- --------------------- ------------------------------\n");
index f82e190901e4faa5f793fe57ee1a0088d8525d34..5263a1399c27ee4f899032a643890bdd3f63dfda 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -132,7 +132,7 @@ public:
     SSL *ssl;
     SSL_CTX *dynamicSslContext; ///< cached and then freed when fd is closed
 #endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     struct {
         long handle;
     } win32;
@@ -185,7 +185,7 @@ private:
         ssl = NULL;
         dynamicSslContext = NULL;
 #endif
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
         win32.handle = NULL;
 #endif
         tosFromServer = '\0';
index 5b66e4365e004883a06d1ab3c0abc7e70d6aaf99..f9e55812edfc982a8a7035971ecaa6be773c1948 100644 (file)
@@ -901,7 +901,7 @@ CossSwapDir::create()
 
     if (::stat(path, &swap_sb) < 0) {
         debugs (47, 2, "COSS swap space space being allocated.");
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
         mkdir(path);
 #else
index 3fa84bc4618a74ef767d06bd215c1237b0fd6c6a..7560be48d404dbb2740fac92cc862ffe5b53988f 100644 (file)
@@ -575,7 +575,7 @@ Fs::Ufs::UFSSwapDir::createDirectory(const char *aPath, int should_exist)
             fatalf("Swap directory %s is not a directory.", aPath);
         }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     } else if (0 == mkdir(aPath)) {
 #else
@@ -1307,7 +1307,7 @@ Fs::Ufs::UFSSwapDir::DirClean(int swap_index)
     if (dir_pointer == NULL) {
         if (errno == ENOENT) {
             debugs(36, DBG_CRITICAL, HERE << "WARNING: Creating " << p1);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
             if (mkdir(p1) == 0)
 #else
index 3980d926d880a0c895b0cc0b725f55d4582f7b54..517e0d895ff94c912128a532c455628573f1a0d6 100644 (file)
@@ -115,7 +115,7 @@ extern size_t store_pages_max;      /* 0 */
 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_
index 73c4b8855f0cc137a4eb03011918c1671bee3bb8..85d0dc0392f3df9c87d61f02d4fdaf3835c8347c 100644 (file)
@@ -96,7 +96,7 @@ HelperServerBase::initStats()
 void
 HelperServerBase::closePipesSafely()
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     int no = index + 1;
 
     shutdown(writePipe->fd, SD_BOTH);
@@ -109,7 +109,7 @@ HelperServerBase::closePipesSafely()
         readPipe->close();
     writePipe->close();
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
             getCurrentTime();
@@ -125,7 +125,7 @@ HelperServerBase::closePipesSafely()
 void
 HelperServerBase::closeWritePipeSafely()
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     int no = index + 1;
 
     shutdown(writePipe->fd, (readPipe->fd == writePipe->fd ? SD_BOTH : SD_SEND));
@@ -136,7 +136,7 @@ HelperServerBase::closeWritePipeSafely()
         readPipe->fd = -1;
     writePipe->close();
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
             getCurrentTime();
index 231fc668d7a3af99d859941e3cd1c76311d61658..6a39f2c5d6e6abe6d23c85d1b0e443d5db64cb47 100644 (file)
@@ -83,7 +83,7 @@
 #if _SQUID_WINDOWS_
 #include "fde.h"
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
@@ -123,7 +123,7 @@ typedef struct icmphdr {
     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
index 76580c3d92690382afc5a10e087e3570bc952352..e69123a6da9729abe40a711e0b3f9ca371b24322 100644 (file)
@@ -58,7 +58,7 @@ IcmpPinger::~IcmpPinger()
     Close();
 }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 void
 Win32SockCleanup(void)
 {
@@ -70,7 +70,7 @@ Win32SockCleanup(void)
 int
 IcmpPinger::Open(void)
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     WSADATA wsaData;
     WSAPROTOCOL_INFO wpi;
@@ -152,7 +152,7 @@ IcmpPinger::Open(void)
 
     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 @@ IcmpPinger::Open(void)
 void
 IcmpPinger::Close(void)
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     shutdown(icmp_sock, SD_BOTH);
     close(icmp_sock);
index 4d5490be4f64bdc6fc509e48ee6c51723d162c02..d2cd6a647d9207760b462354c8b60368c061e315 100644 (file)
@@ -263,11 +263,11 @@ IcmpSquid::Open(void)
     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 @@ IcmpSquid::Close(void)
 
     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 @@ IcmpSquid::Close(void)
 
     comm_close(icmp_sock);
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) {
index 3151ab55c47d6193438065b077c22df1dd87e101..a9a25421f382446b04dc581aaa33667b533c5a27 100644 (file)
@@ -71,7 +71,7 @@
 #include "Icmp6.h"
 #include "IcmpPinger.h"
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
@@ -105,7 +105,7 @@ Win32__WSAFDIsSet(int fd, fd_set FAR * set)
 /* 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;
index 9ec57cba0f86a49e08e23ddddbc053b208880ad3..520ed926716b70eadfced119ea254867f060b2a4 100644 (file)
@@ -45,7 +45,7 @@
 #if HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
-#if _SQUID_MSWIN_
+#if HAVE_WS2TCPIP_H
 #include <ws2tcpip.h>
 #endif
 #if HAVE_NETDB_H
index a0e91a12b66e2cfd5a9808d625dc4fbb10a8acb8..5468467d8fc3cb0c0d9788ba2b3aaa69068b3d9e 100644 (file)
@@ -203,7 +203,7 @@ static void SquidShutdown(void);
 static void mainSetCwd(void);
 static int checkRunningPid(void);
 
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 static const char *squid_start_script = "squid_start";
 #endif
 
@@ -618,7 +618,7 @@ rotate_logs(int sig)
 {
     do_rotate = 1;
     RotateSignal = sig;
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 #if !HAVE_SIGACTION
 
     signal(sig, rotate_logs);
@@ -632,7 +632,7 @@ reconfigure(int sig)
 {
     do_reconfigure = 1;
     ReconfigureSignal = sig;
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 #if !HAVE_SIGACTION
 
     signal(sig, reconfigure);
@@ -661,7 +661,7 @@ shut_down(int sig)
                    " pid " << ppid << ": " << xstrerror());
     }
 
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 #if KILL_PARENT_OPT
 
     if (!IamMasterProcess() && ppid > 1) {
@@ -1019,7 +1019,7 @@ mainInitialize(void)
     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");
 
@@ -1576,7 +1576,7 @@ sendSignal(void)
     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.
@@ -1619,7 +1619,7 @@ mainStartScript(const char *prog)
     }
 }
 
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
 
 static int
 checkRunningPid(void)
@@ -1649,7 +1649,7 @@ checkRunningPid(void)
 static void
 watch_child(char *argv[])
 {
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
     char *prog;
 #if _SQUID_NEXT_
 
@@ -1818,7 +1818,7 @@ watch_child(char *argv[])
     }
 
     /* NOTREACHED */
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
 
 }
 
index 0e1e530790afcd811048d139a115765c0342c1dc..addd853dd2a45fef400de0f882d89c1a5ab3cd6b 100644 (file)
@@ -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 @@ Ssl::Lock::Lock(std::string const &aFilename) :
 
 bool Ssl::Lock::locked() const
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     return hFile != INVALID_HANDLE_VALUE;
 #else
     return fd != -1;
@@ -43,7 +43,7 @@ bool Ssl::Lock::locked() const
 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 @@ void Ssl::Lock::lock()
 #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::lock()
 
 void Ssl::Lock::unlock()
 {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
     if (hFile != INVALID_HANDLE_VALUE) {
         UnlockFile(hFile, 0, 0, 1, 0);
         CloseHandle(hFile);
index 1a2b07b7f1ade0d203e89a3d5dc895ae0e8189e4..c817fa3390cb446243b490b05987f29a11c9693d 100644 (file)
@@ -23,7 +23,7 @@ public:
     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.
index 5b6f0bf0cadcfdac2759643529336090bfaa8b28..efff316471e26bcabc93b20e607047a51498911f 100644 (file)
@@ -244,7 +244,7 @@ int asn1timeToString(ASN1_TIME *tm, char *buf, int len);
 bool setClientSNI(SSL *ssl, const char *fqdn);
 } //namespace Ssl
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 #if defined(__cplusplus)
 
@@ -272,6 +272,6 @@ int SSL_set_fd(SSL *ssl, int fd)
 
 #endif /* __cplusplus */
 
-#endif /* _SQUID_MSWIN_ */
+#endif /* _SQUID_WINDOWS_ */
 
 #endif /* SQUID_SSL_SUPPORT_H */
index d8acbdb02c08d72379c4aca898648c85d60c043c..fb82c2170274eb9a0d3e3008cc837d778f5b6a5c 100644 (file)
@@ -124,7 +124,7 @@ StoreController::createOneStore(Store &aStore)
      * 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;
@@ -133,7 +133,7 @@ StoreController::createOneStore(Store &aStore)
 
     aStore.create();
 
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 
     exit(0);
 
@@ -145,7 +145,7 @@ StoreController::create()
 {
     swapDir->create();
 
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 
     pid_t pid;
 
index 61706628317ac6456d9e50ca1699166a04282089..440d7652c06e1400e7dab3f69fc69ca43cd2b5d9 100644 (file)
@@ -368,7 +368,7 @@ death(int sig)
 #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);
@@ -456,7 +456,7 @@ debug_trap(const char *message)
 void
 sig_child(int sig)
 {
-#if !_SQUID_MSWIN_
+#if !_SQUID_WINDOWS_
 #if _SQUID_NEXT_
     union wait status;
 #else
@@ -995,7 +995,7 @@ squid_signal(int sig, SIGHDLR * func, int flags)
         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.
index 64224a83e4cc533abc8eff9a0c5161134fb6a8dd..6edf0d822ec5ef4ad5c62e380772c9c37ba518cd 100644 (file)
@@ -149,7 +149,7 @@ unlinkdUnlink(const char *path)
 
 void
 unlinkdClose(void)
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 {
 
     if (unlinkd_wfd > -1) {
@@ -224,7 +224,7 @@ unlinkdInit(void)
 #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 @@ unlinkdInit(void)
 
     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);
 
index 7d2bfd64f901c67518e9ce0ff822a2b7f46b0915..ba039a5c073b931374e6ee9c82b33eab774d637c 100644 (file)
@@ -35,7 +35,7 @@
 #include "squid_windows.h"
 #include "win32.h"
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #if HAVE_WIN32_PSAPI
 #include <psapi.h>
 #endif
index 5834dba61e2a8c04d0235de97bd0e7fe4991eb4b..d5719a62dce4f307a13bd65b1cfadae99ffc22a9 100644 (file)
@@ -33,7 +33,7 @@
  *
  */
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
 #if HAVE_SYS_TIME_H
 #include <sys/time.h>
index e0c1a8fddaee689bcffc5ec73606eba794b8dc75..6785aa62a02d69ffc5791ae0a1957339f2fc73bb 100644 (file)
@@ -164,7 +164,7 @@ static const char *make_auth_header(const cachemgr_request * req);
 
 static int check_target_acl(const char *hostname, int port);
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 static int s_iInitCount = 0;
 
 int Win32SockInit(void)
@@ -607,7 +607,7 @@ static int
 read_reply(int s, cachemgr_request * req)
 {
     char buf[4 * 1024];
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     int reply;
     char *tmpfile = tempnam(NULL, "tmp0000");
@@ -631,7 +631,7 @@ read_reply(int s, cachemgr_request * req)
         parse_menu = 1;
 
     if (fp == NULL) {
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
         perror(tmpfile);
         xfree(tmpfile);
 #else
@@ -643,7 +643,7 @@ read_reply(int s, cachemgr_request * req)
         return 1;
     }
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     while ((reply=recv(s, buf , sizeof(buf), 0)) > 0)
         fwrite(buf, 1, reply, fp);
@@ -782,7 +782,7 @@ read_reply(int s, cachemgr_request * req)
     }
 
     fclose(fp);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     remove(tmpfile);
     xfree(tmpfile);
@@ -897,7 +897,7 @@ main(int argc, char *argv[])
     cachemgr_request *req;
 
     now = time(NULL);
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     Win32SockInit();
     atexit(Win32SockCleanup);
@@ -1005,7 +1005,7 @@ read_request(void)
     else
         return NULL;
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 
     if (strlen(buf) == 0 || strlen(buf) == 4000)
 #else