From: Francesco Chemolli Date: Sat, 28 Jan 2012 17:24:17 +0000 (+0100) Subject: Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6adf27288775aa0a7d51c28c815476f2d255f7f;p=thirdparty%2Fsquid.git Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere. --- diff --git a/src/debug.cc b/src/debug.cc index a2eb7d2c4f..b30e637e26 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -64,7 +64,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_ SQUIDCEXTERN LPCRITICAL_SECTION dbg_mutex; typedef BOOL (WINAPI * PFInitializeCriticalSectionAndSpinCount) (LPCRITICAL_SECTION, DWORD); #endif @@ -78,7 +78,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) { @@ -131,7 +131,7 @@ _db_print(const char *format,...) _db_print_syslog(format, args3); #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ LeaveCriticalSection(dbg_mutex); #endif @@ -487,7 +487,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 @@ -498,14 +498,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 diff --git a/src/defines.h b/src/defines.h index 5d9a81d0d4..89428e7a11 100644 --- a/src/defines.h +++ b/src/defines.h @@ -211,7 +211,7 @@ /* * Max number of ICP messages to receive per call to icpHandleUdp */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #define INCOMING_ICP_MAX 1 #else #define INCOMING_ICP_MAX 15 @@ -219,7 +219,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 @@ -228,7 +228,7 @@ * Max number of HTTP connections to accept per call to httpAccept * and PER HTTP PORT */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #define INCOMING_HTTP_MAX 1 #else #define INCOMING_HTTP_MAX 10 diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 2aca1f59d7..ee9613a52e 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -224,7 +224,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_ @@ -356,7 +356,7 @@ idnsParseNameservers(void) } } -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ static void idnsParseResolvConf(void) { @@ -1510,7 +1510,7 @@ dnsInit(void) assert(0 == nns); idnsParseNameservers(); -#if !_SQUID_MSWIN_ +#if !_SQUID_WINDOWS_ if (0 == nns) idnsParseResolvConf(); diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 6ad1771176..b1f391ed29 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -494,7 +494,7 @@ main(int argc, char *argv[]) } } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ { WSADATA wsaData; @@ -508,7 +508,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); diff --git a/src/globals.h b/src/globals.h index 4165e0090c..62eb01e932 100644 --- a/src/globals.h +++ b/src/globals.h @@ -133,7 +133,7 @@ extern "C" { 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 diff --git a/src/icmp/Icmp4.h b/src/icmp/Icmp4.h index 60ea6eb1a5..b732ce9b80 100644 --- a/src/icmp/Icmp4.h +++ b/src/icmp/Icmp4.h @@ -86,7 +86,7 @@ #if _SQUID_WINDOWS_ #include "fde.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_WINSOCK2_H #include @@ -126,7 +126,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 diff --git a/src/icmp/IcmpPinger.cc b/src/icmp/IcmpPinger.cc index 6d1c66c721..085a8d2cf1 100644 --- a/src/icmp/IcmpPinger.cc +++ b/src/icmp/IcmpPinger.cc @@ -56,7 +56,7 @@ IcmpPinger::~IcmpPinger() Close(); } -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ void Win32SockCleanup(void) { @@ -68,7 +68,7 @@ Win32SockCleanup(void) int IcmpPinger::Open(void) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ WSADATA wsaData; WSAPROTOCOL_INFO wpi; @@ -150,7 +150,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 ?? @@ -162,7 +162,7 @@ IcmpPinger::Open(void) void IcmpPinger::Close(void) { -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ shutdown(icmp_sock, SD_BOTH); close(icmp_sock); diff --git a/src/icmp/IcmpSquid.cc b/src/icmp/IcmpSquid.cc index 46f9e5e800..3af7efcb2c 100644 --- a/src/icmp/IcmpSquid.cc +++ b/src/icmp/IcmpSquid.cc @@ -260,11 +260,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; @@ -281,7 +281,7 @@ IcmpSquid::Close(void) debugs(37, 1, HERE << "Closing Pinger socket on FD " << icmp_sock); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ send(icmp_sock, (const void *) "$shutdown\n", 10, 0); @@ -289,7 +289,7 @@ IcmpSquid::Close(void) comm_close(icmp_sock); -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ if (hIpc) { if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) { diff --git a/src/icmp/pinger.cc b/src/icmp/pinger.cc index 1bbefdd122..e2f58ba807 100644 --- a/src/icmp/pinger.cc +++ b/src/icmp/pinger.cc @@ -72,7 +72,7 @@ #include "Icmp6.h" #include "IcmpPinger.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #if HAVE_WINSOCK2_H #include @@ -106,7 +106,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; diff --git a/src/protos.h b/src/protos.h index f6b849cae6..aef3e05f3c 100644 --- a/src/protos.h +++ b/src/protos.h @@ -673,7 +673,7 @@ SQUIDCEXTERN void WIN32_InstallService(void); SQUIDCEXTERN void WIN32_RemoveService(void); SQUIDCEXTERN int SquidMain(int, char **); #endif /* _SQUID_WINDOWS_ */ -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ SQUIDCEXTERN int WIN32_pipe(int[2]); diff --git a/src/squid-old.h b/src/squid-old.h index a5ccf4953e..a8814ca1dd 100644 --- a/src/squid-old.h +++ b/src/squid-old.h @@ -34,7 +34,7 @@ #include "squid.h" -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ /** \cond AUTODOCS-IGNORE */ using namespace Squid; /** \endcond */ diff --git a/src/ssl/certificate_db.cc b/src/ssl/certificate_db.cc index 7acf4178a4..66f75d0ddb 100644 --- a/src/ssl/certificate_db.cc +++ b/src/ssl/certificate_db.cc @@ -27,7 +27,7 @@ Ssl::Lock::Lock(std::string const &aFilename) : filename(aFilename), -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ hFile(INVALID_HANDLE_VALUE) #else fd(-1) @@ -37,7 +37,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; @@ -47,7 +47,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 @@ -57,7 +57,7 @@ void Ssl::Lock::lock() 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) @@ -67,7 +67,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); diff --git a/src/ssl/certificate_db.h b/src/ssl/certificate_db.h index 3035251431..3ea344928b 100644 --- a/src/ssl/certificate_db.h +++ b/src/ssl/certificate_db.h @@ -28,7 +28,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.