]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability polish: use #if instead of #ifdef or #ifndef
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 23 Jul 2011 08:37:52 +0000 (20:37 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 23 Jul 2011 08:37:52 +0000 (20:37 +1200)
... when _SQUID_OS_ macros are involved. Coding guidelines since 3.1 have
been not to. This cleans up all current variations from the guideline.

58 files changed:
compat/getaddrinfo.c
compat/os/aix.h
compat/os/dragonfly.h
compat/os/freebsd.h
compat/os/hpux.h
compat/os/linux.h
compat/os/macosx.h
compat/os/netbsd.h
compat/os/next.h
compat/os/openbsd.h
compat/os/os2.h
compat/os/qnx.h
compat/os/sunos.h
compat/types.h
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/util.h
scripts/source-maintenance.sh
src/DiskIO/AIO/aio_win32.h
src/WinSvc.cc
src/cache_manager.cc
src/cf_gen.cc
src/comm.cc
src/debug.cc
src/defines.h
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/store_dir_ufs.cc
src/globals.h
src/helper.cc
src/icmp/Icmp4.h
src/icmp/IcmpPinger.cc
src/icmp/IcmpSquid.cc
src/icmp/pinger.cc
src/icp_v2.cc
src/ip/Address.h
src/ipc/Kid.h
src/main.cc
src/protos.h
src/squid.h
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
tools/cachemgr.cc
tools/squidclient.cc

index 4fdc03dc48b46cbd1bc5e16cb88ce538c7eaf748..2119b161d3c026f9d0687f2d7f28f3471f832e71 100644 (file)
@@ -73,7 +73,7 @@
 #if HAVE_NETDB_H
 #include <netdb.h>
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #undef IN_ADDR
 #include <ws2tcpip.h>
 #endif
index ac933ac294b1ddd6d2e2f65547c619fa7b8e9e20..8a540ae9d632f4fab52b375c3064b1ca34b3ed63 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_AIX_H
 #define SQUID_OS_AIX_H
 
-#ifdef _SQUID_AIX_
+#if _SQUID_AIX_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 6fe742eb61d0e37c9c7842eeee62fbce940acb4f..8390a1360aea19f23c2bc21b73e37bac83e7c602 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_DRAGONFLY_H
 #define SQUID_OS_DRAGONFLY_H
 
-#ifdef _SQUID_DRAGONFLY_
+#if _SQUID_DRAGONFLY_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index e8eff26c86de91f61338bcae4204ca8ffb5d3f68..531e378e5b8de2694fdef94bdde8af5498029ae4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_FREEBSD_H
 #define SQUID_OS_FREEBSD_H
 
-#ifdef _SQUID_FREEBSD_
+#if _SQUID_FREEBSD_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 9cdcd5cb320013af8cbd8f3454f68eace265f0d0..a90e4b2a097dea6169c221f6cb2b26383180ae69 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_HPUX_H
 #define SQUID_OS_PHUX_H
 
-#ifdef _SQUID_HPUX_
+#if _SQUID_HPUX_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index d4ea1fb87da090730847dfcec3b9da89e4cd93be..a5261dc4d3a8b1770bd3529d4a6bd9825f276f6f 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_LINUX_H
 #define SQUID_OS_LINUX_H
 
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 41abbccdc9c13caaab58e3082cc194949ff9699b..e601614f112e06dc19b145cbdac7fb9364540669 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_MACOSX_H
 #define SQUID_OS_MACOSX_H
 
-#ifdef _SQUID_APPLE_
+#if _SQUID_APPLE_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index dd48070f2f76959fd3054476ead265e0e46601cd..813d20f471ba6e0b79d9b285e56416b6649545b4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_NETBSD_H
 #define SQUID_OS_NETBSD_H
 
-#ifdef _SQUID_NETBSD_
+#if _SQUID_NETBSD_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 016188abbfbe78850304fb27e69f2830fafc8f64..556777e3848a3abbafed1c3b6c9e883e8040da6e 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_NEXT_H
 #define SQUID_OS_NEXT_H
 
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 87c7e978084bc04adfc6f5cfc2fa0254a1965b1e..7df8d82747995220550ca44e5207328bd0727240 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_OPENBSD_H
 #define SQUID_OS_OPENBSD_H
 
-#ifdef _SQUID_OPENBSD_
+#if _SQUID_OPENBSD_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index f957945bea0dc4684ddc359b40457ac231079e1d..72d943a321da3364f89d6ebffa9f814eefa51ac1 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_OS2_H
 #define SQUID_OS_OS2_H
 
-#ifdef _SQUID_OS2_
+#if _SQUID_OS2_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 1c0d5e35acca775fa95bd61ee17b44c95d2454f0..1242e74e3a93191d24babd47004dc1dedfaf655c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_QNX_H
 #define SQUID_OS_QNX_H
 
-#ifdef _SQUID_QNX_
+#if _SQUID_QNX_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 1f9a766d86a21830fefcc8e1d80498f2317d192a..ad0775401f223ec520fd59163dab69f1b18a158a 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SQUID_OS_SUNOS_H
 #define SQUID_OS_SUNOS_H
 
-#ifdef _SQUID_SUNOS_
+#if _SQUID_SUNOS_
 
 /****************************************************************************
  *--------------------------------------------------------------------------*
index 5026a46107ab4cc277d49ab98bef895f4bfbecab..707a45191f62f38d056f3067ca87e75ca2840038 100644 (file)
@@ -93,7 +93,7 @@
  * "%lx" instead of "%llx"
  */
 #ifndef PRId64
-#ifdef _SQUID_MSWIN_           /* Windows native port using MSVCRT */
+#if _SQUID_MSWIN_              /* Windows native port using MSVCRT */
 #define PRId64 "I64d"
 #elif SIZEOF_INT64_T > SIZEOF_LONG
 #define PRId64 "lld"
 #endif
 
 #ifndef PRIu64
-#ifdef _SQUID_MSWIN_           /* Windows native port using MSVCRT */
+#if _SQUID_MSWIN_              /* Windows native port using MSVCRT */
 #define PRIu64 "I64u"
 #elif SIZEOF_INT64_T > SIZEOF_LONG
 #define PRIu64 "llu"
 #endif
 
 #ifndef PRIX64
-#ifdef _SQUID_MSWIN_           /* Windows native port using MSVCRT */
+#if _SQUID_MSWIN_              /* Windows native port using MSVCRT */
 #define PRIX64 "I64X"
 #elif SIZEOF_INT64_T > SIZEOF_LONG
 #define PRIX64 "llX"
index 63b6c2fb4bb8b0ee5f071b62229b2a7a26cb9915..2ec5ef4d96ec302a821fa4c2018c466a305af9b7 100644 (file)
@@ -93,7 +93,7 @@
 #include <string.h>
 #include <ctype.h>
 
-#ifdef _SQUID_MSWIN_           /* Native Windows port and MinGW */
+#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
 
 #define snprintf _snprintf
 #include <windows.h>
@@ -554,7 +554,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
      */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (use_tls) {
 
         HMODULE WLDAP32Handle;
index c52f9043b1ecf2411b44decc0bdfaae9773f6a91..d219551873a5442496e3350959f91922e7236bf7 100644 (file)
@@ -120,14 +120,14 @@ static int retries = 30;
 
 char progname[] = "basic_radius_auth";
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 void
 Win32SockCleanup(void)
 {
     WSACleanup();
     return;
 }
-#endif /* ifdef _SQUID_MSWIN_ */
+#endif
 
 /*
  *    Diff two timeval, b - a
@@ -498,7 +498,7 @@ main(int argc, char **argv)
         fprintf(stderr, "FATAL: %s: Shared secret not specified\n", argv[0]);
         exit(1);
     }
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     {
         WSADATA wsaData;
         WSAStartup(2, &wsaData);
index 39c599639c556f813bcaf0941bd058da76200887..c6113b66e7c99a4fce12f2ac4f6f6779b06b5032 100644 (file)
@@ -88,7 +88,7 @@ static void
 debug(char *format,...)
 {
 #ifdef DEBUG
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (debug_enabled) {
         va_list args;
 
index 74fca3263a639ac44ebae39405534a93f991c22a..d6a6deb5f747fb46e6b00281ab0e8118fd7f0df4 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "ldap_backend.h"
 
-#ifdef _SQUID_MSWIN_           /* Native Windows port and MinGW */
+#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
 
 #define snprintf _snprintf
 #include <windows.h>
@@ -301,7 +301,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
      */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (use_tls) {
 
         HMODULE WLDAP32Handle;
index d688fbcf58500c58ee3f0427a1f4da0b10fc5fca..48921f84009cdadc839c371e405ceafa2840f64a 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "digest_common.h"
 
-#ifdef _SQUID_MSWIN_            /* Native Windows port and MinGW */
+#if _SQUID_MSWIN_            /* Native Windows port and MinGW */
 
 #define snprintf _snprintf
 #include <windows.h>
index 109928dca0511336b3b7c2b308f45b8a24bddbaf..5281369f039fbcbe9bb90d358d546cca8e23fc2b 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "ldap_backend.h"
 
-#ifdef _SQUID_MSWIN_           /* Native Windows port and MinGW */
+#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
 
 #define snprintf _snprintf
 #include <windows.h>
@@ -329,7 +329,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
      */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (use_tls) {
 
         HMODULE WLDAP32Handle;
index c843d07390807b0c356c6dfc2436a004c8ee8ea4..135a21bd5edeab1ed8ec2c17d57d04bb28374cda 100644 (file)
@@ -51,7 +51,7 @@
 #include <ctype.h>
 #endif
 
-#ifdef _SQUID_MSWIN_           /* Native Windows port and MinGW */
+#if _SQUID_MSWIN_              /* Native Windows port and MinGW */
 
 #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
      */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (use_tls) {
 
         HMODULE WLDAP32Handle;
index 4f4e426a75ea4693bc5bed1a4dcfd6b6853c6d69..d797d31b3b8e3356db7c5cae57d174d4dd83294e 100644 (file)
@@ -115,7 +115,7 @@ SQUIDCEXTERN unsigned int RoundTo(const unsigned int num, const unsigned int wha
 
 /* Windows Port */
 /* win32lib.c */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 SQUIDCEXTERN int chroot (const char *);
 SQUIDCEXTERN int ftruncate(int, off_t);
 #if !HAVE_GETTIMEOFDAY
index 890f17319b00f8ccb5ac3deee38329bfc3bf80ad..789d74f7a4728bca3e40b66d59149b73006e0ccc 100755 (executable)
@@ -77,6 +77,11 @@ for FILENAME in `ls -1`; do
                ;;
        esac
 
+       #
+       # Scan for incorrect use of #ifdef/#ifndef
+       #
+       grep -R -E "ifn?def .*_SQUID_" ./* | grep -v -E "_H$" | while read f; do echo "PROBLEM?: ${f}"; done
+
        #
        # DEBUG Section list maintenance
        #
index cea94bacfae20dae8a088038bf6f3e171c0fed3b..099e846edb4c9edef05c382072aa9cd19caffa4b 100644 (file)
@@ -44,7 +44,7 @@
 typedef int64_t        off64_t;
 #endif
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
 union sigval {
     int sival_int; /* integer value */
index 5bfebdcf2b6c20481957d8ae88c8cb8284d11faa..13f6549d7bc861b925e555c5f8b8c21a607a7c5e 100644 (file)
@@ -37,7 +37,7 @@
 #include "squid.h"
 #include "squid_windows.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #ifndef _MSWSOCK_
 #include <mswsock.h>
 #endif
@@ -401,7 +401,7 @@ WIN32_Abort(int sig)
     WIN32_Exit();
 }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 void
 WIN32_IpAddrChangeMonitorExit()
 {
@@ -417,7 +417,7 @@ WIN32_IpAddrChangeMonitorExit()
 void
 WIN32_Exit()
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     Win32SockCleanup();
 #endif
 #if USE_WIN32_SERVICE
@@ -430,7 +430,7 @@ WIN32_Exit()
     }
 
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (dbg_mutex)
         DeleteCriticalSection(dbg_mutex);
 
@@ -442,7 +442,7 @@ WIN32_Exit()
     _exit(0);
 }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 static DWORD WINAPI
 WIN32_IpAddrChangeMonitor(LPVOID lpParam)
 {
@@ -580,7 +580,7 @@ int WIN32_Subsystem_Init(int * argc, char *** argv)
         svcStatus.dwCheckPoint = 0;
         svcStatus.dwWaitHint = 10000;
         SetServiceStatus(svcHandle, &svcStatus);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
         _setmaxstdio(Squid_MaxFD);
 #endif
@@ -588,7 +588,7 @@ int WIN32_Subsystem_Init(int * argc, char *** argv)
     }
 
 #endif /* USE_WIN32_SERVICE */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (Win32SockInit() < 0)
         return 1;
 
@@ -964,7 +964,7 @@ int main(int argc, char **argv)
         }
     } else {
         WIN32_run_mode = _WIN_SQUID_RUN_MODE_INTERACTIVE;
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
         opt_no_daemon = 1;
 
index efe8caf85e258f466f395f0d9173611ba3ee3f05..bb00a4aa18efc5eb202e62ba4d019b6ca6e28d1f 100644 (file)
@@ -211,7 +211,7 @@ CacheManager::ParseUrl(const char *url)
     if (t < 2)
         xstrncpy(request, "menu", MAX_URL);
 
-#ifdef _SQUID_OS2_
+#if _SQUID_OS2_
     if (t == 2 && request[0] == '\0') {
         /*
          * emx's sscanf insists of returning 2 because it sets request
index 1f940076249edddc9f994c3f72336c291e19eb92..aeab025cceb1f3f0877438e4df9c412282fcb202 100644 (file)
@@ -187,7 +187,7 @@ main(int argc, char *argv[])
     enum State state;
     int rc = 0;
     char *ptr = NULL;
-#ifdef _SQUID_OS2_
+#if _SQUID_OS2_
 
     const char *rmode = "rt";
 #else
index 35b3b2a0aae920f0d5c6053d80efd490e38813f3..a6ab545de771c507acf9ee3ffc0db90261f67d16 100644 (file)
@@ -189,7 +189,7 @@ comm_read(const Comm::ConnectionPointer &conn, char *buf, int size, AsyncCall::P
 static void
 comm_empty_os_read_buffers(int fd)
 {
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
     /* prevent those nasty RST packets */
     char buf[SQUID_TCP_SO_RCVBUF];
 
@@ -645,7 +645,7 @@ comm_apply_flags(int new_socket,
         commSetReuseAddr(new_socket);
 
     if (addr.GetPort() > (u_short) 0) {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         if (sock_type != SOCK_DGRAM)
 #endif
             commSetNoLinger(new_socket);
@@ -704,7 +704,7 @@ comm_import_opened(const Comm::ConnectionPointer &conn,
         fd_table[conn->fd].flags.close_on_exec = 1;
 
     if (conn->local.GetPort() > (u_short) 0) {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         if (AI->ai_socktype != SOCK_DGRAM)
 #endif
             fd_table[conn->fd].flags.nolinger = 1;
@@ -910,7 +910,7 @@ comm_connect_addr(int sock, const Ip::Address &address)
      * we leak memory on many connect requests because of EINPROGRESS.
      * If you find that this code is needed, please file a bug report. */
 #if 0
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
     /* 2007-11-27:
      * Linux Debian replaces our allocated AI pointer with garbage when
      * connect() fails. This leads to segmentation faults deallocating
@@ -1204,7 +1204,7 @@ comm_udp_sendto(int fd,
     if (x >= 0)
         return x;
 
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
 
     if (ECONNREFUSED != errno)
 #endif
@@ -1324,7 +1324,7 @@ commSetTcpRcvbuf(int fd, int size)
 int
 commSetNonBlocking(int fd)
 {
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
     int flags;
     int dummy = 0;
 #endif
@@ -1344,7 +1344,7 @@ commSetNonBlocking(int fd)
     } else {
 #endif
 #endif
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 
         if ((flags = fcntl(fd, F_GETFL, dummy)) < 0) {
             debugs(50, 0, "FD " << fd << ": fcntl F_GETFL: " << xstrerror());
@@ -1368,7 +1368,7 @@ commSetNonBlocking(int fd)
 int
 commUnsetNonBlocking(int fd)
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     int nonblocking = FALSE;
 
     if (ioctlsocket(fd, FIONBIO, (unsigned long *) &nonblocking) < 0) {
index f6e6b50471326116bb559aa7cc5e5db4a92fd8a3..05ef8f6bff595b45ae5ede2877d8be65a9baa7c4 100644 (file)
@@ -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);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 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;
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     /* 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
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     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);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         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.
      */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     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);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         remove
         (to);
 #endif
index 40936b532486f804b898743a83df8bebcc557b06..c0e2c87aa756c0a67fcdb39529f1c4a2647db2b9 100644 (file)
 /*
  * Max number of ICP messages to receive per call to icpHandleUdp
  */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #define INCOMING_ICP_MAX 1
 #else
 #define INCOMING_ICP_MAX 15
 /*
  * Max number of DNS messages to receive per call to DNS read handler
  */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #define INCOMING_DNS_MAX 1
 #else
 #define INCOMING_DNS_MAX 15
  * Max number of HTTP connections to accept per call to httpAccept
  * and PER HTTP PORT
  */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #define INCOMING_HTTP_MAX 1
 #else
 #define INCOMING_HTTP_MAX 10
index 44532a174a8caec95d3c9f721136e7819d2ba1fa..994416a3e70859eb393e99fbd224a05fb3d1c4b5 100644 (file)
@@ -225,7 +225,7 @@ static void idnsAddPathComponent(const char *buf);
 static void idnsFreeNameservers(void);
 static void idnsFreeSearchpath(void);
 static void idnsParseNameservers(void);
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 static void idnsParseResolvConf(void);
 #endif
 #if _SQUID_WINDOWS_
@@ -356,7 +356,7 @@ idnsParseNameservers(void)
     }
 }
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 static void
 idnsParseResolvConf(void)
 {
@@ -1278,7 +1278,7 @@ idnsRead(int fd, void *data)
             if (ignoreErrno(errno))
                 break;
 
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
             /* Some Linux systems seem to set the FD for reading and then
              * return ECONNREFUSED when sendto() fails and generates an ICMP
              * port unreachable message. */
@@ -1530,7 +1530,7 @@ idnsInit(void)
 
     assert(0 == nns);
     idnsParseNameservers();
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 
     if (0 == nns)
         idnsParseResolvConf();
index 62051389558a2c94586812535e8c07922414fd39..420921f6939b1646abd00ff209659eb2d3a4436d 100644 (file)
@@ -491,7 +491,7 @@ main(int argc, char *argv[])
         }
     }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     {
         WSADATA wsaData;
 
@@ -505,7 +505,7 @@ main(int argc, char *argv[])
         memset(request, '\0', REQ_SZ);
 
         if (fgets(request, REQ_SZ, stdin) == NULL) {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
             WSACleanup();
 #endif
             exit(1);
index e76178ac04a594e2803f87734b9e0970df434eb9..36a26b8adfa9d8a40e63075e2af5098c86c00f2f 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);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 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();
 }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
 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;
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     F->win32.handle = _get_osfhandle(fd);
 
index b66542cf41bf66586b48f1185608cf11dba6c75d..49bd5300b8ab3b6c1aa94ad70d3245dff17a8f04 100644 (file)
@@ -54,7 +54,7 @@ fde::dumpStats (StoreEntry &dumpEntry, int fdNumber)
     if (!flags.open)
         return;
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     storeAppendPrintf(&dumpEntry, "%4d 0x%-8lX %-6.6s %4d %7"PRId64"%c %7"PRId64"%c %-21s %s\n",
                       fdNumber,
@@ -78,7 +78,7 @@ fde::DumpStats (StoreEntry *dumpEntry)
 {
     int i;
     storeAppendPrintf(dumpEntry, "Active file descriptors:\n");
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     storeAppendPrintf(dumpEntry, "%-4s %-10s %-6s %-4s %-7s* %-7s* %-21s %s\n",
                       "File",
@@ -93,7 +93,7 @@ fde::DumpStats (StoreEntry *dumpEntry)
                       "Nwrite",
                       "Remote Address",
                       "Description");
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     storeAppendPrintf(dumpEntry, "---- ---------- ------ ---- -------- -------- --------------------- ------------------------------\n");
 #else
     storeAppendPrintf(dumpEntry, "---- ------ ---- -------- -------- --------------------- ------------------------------\n");
index 8cdfdd1a2b84ed60f91ce5d17e00ffaf64748122..94cf3568df9e8a7d53cf173bc5d453361a8ee61a 100644 (file)
--- a/src/fde.h
+++ b/src/fde.h
@@ -115,7 +115,7 @@ public:
     SSL *ssl;
     SSL_CTX *dynamicSslContext; ///< cached and then freed when fd is closed
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     struct {
         long handle;
     } win32;
@@ -169,7 +169,7 @@ private:
         ssl = NULL;
         dynamicSslContext = NULL;
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         win32.handle = NULL;
 #endif
         tosFromServer = '\0';
index 025139c4018f4db8b54e3c6a73d44795d64966ce..d30ec64fda2f7f49863b0dac156f57a185a8bbaf 100644 (file)
@@ -909,7 +909,7 @@ CossSwapDir::create()
 
     if (::stat(path, &swap_sb) < 0) {
         debugs (47, 2, "COSS swap space space being allocated.");
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
         mkdir(path);
 #else
index cd706d7fdf353b14adaa11c21fab3a4551f8b8cd..f5a36783b723c27697b8a83ccbe262b274a68efb 100644 (file)
@@ -502,7 +502,7 @@ UFSSwapDir::createDirectory(const char *aPath, int should_exist)
             fatalf("Swap directory %s is not a directory.", aPath);
         }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     } else if (0 == mkdir(aPath)) {
 #else
@@ -1090,7 +1090,7 @@ UFSSwapDir::DirClean(int swap_index)
     if (dir_pointer == NULL) {
         if (errno == ENOENT) {
             debugs(36, 0, "storeDirClean: WARNING: Creating " << p1);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
             if (mkdir(p1) == 0)
 #else
index 57c0672d5529382792fca1936d9d262a71bef539..835c085b61b8ff667e182312da9d953810e0885a 100644 (file)
@@ -135,7 +135,7 @@ extern "C" {
     extern int64_t store_maxobjsize;   /* -1 */
     extern hash_table *proxy_auth_username_cache;      /* NULL */
     extern int incoming_sockets_accepted;
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     extern unsigned int WIN32_Socks_initialized;       /* 0 */
 #endif
index c1332329af34057a7ae11df0fe03efa8c7239dd9..9d385f63844e8e22de716d1f390038176da7de9f 100644 (file)
@@ -79,7 +79,7 @@ CBDATA_TYPE(helper_stateful_server);
 void
 HelperServerBase::closePipesSafely()
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     int no = index + 1;
 
     shutdown(writePipe->fd, SD_BOTH);
@@ -92,7 +92,7 @@ HelperServerBase::closePipesSafely()
         readPipe->close();
     writePipe->close();
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
             getCurrentTime();
@@ -108,7 +108,7 @@ HelperServerBase::closePipesSafely()
 void
 HelperServerBase::closeWritePipeSafely()
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     int no = index + 1;
 
     shutdown(writePipe->fd, (readPipe->fd == writePipe->fd ? SD_BOTH : SD_SEND));
@@ -119,7 +119,7 @@ HelperServerBase::closeWritePipeSafely()
         readPipe->fd = -1;
     writePipe->close();
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 5000) != WAIT_OBJECT_0) {
             getCurrentTime();
index 10c869f6ba17331b6e892cd7c1a0659744228ed1..60ea6eb1a58c9f1d2c563189fb58522e1e28c69f 100644 (file)
@@ -52,7 +52,7 @@
 #endif
 
 /* Linux uses its own field names. */
-#if defined (_SQUID_LINUX_)
+#if _SQUID_LINUX_
 #ifdef icmp_id
 #undef icmp_id
 #endif
@@ -86,7 +86,7 @@
 #if _SQUID_WINDOWS_
 #include "fde.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
index 35758b4907d95217324d6c1d05a1d4a66d15fc6b..cea2b37f6a5db3c88c72b03f217f77946e361ab0 100644 (file)
@@ -56,7 +56,7 @@ IcmpPinger::~IcmpPinger()
     Close();
 }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 void
 Win32SockCleanup(void)
 {
@@ -68,7 +68,7 @@ Win32SockCleanup(void)
 int
 IcmpPinger::Open(void)
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     WSADATA wsaData;
     WSAPROTOCOL_INFO wpi;
@@ -162,7 +162,7 @@ IcmpPinger::Open(void)
 void
 IcmpPinger::Close(void)
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     shutdown(icmp_sock, SD_BOTH);
     close(icmp_sock);
index d530553164703d1d373b7b9d41b63f2d85b2b3b9..125867f7155c3e49b8b6bb0728959a9ccd0f839d 100644 (file)
@@ -260,7 +260,7 @@ IcmpSquid::Open(void)
     if (localhost.SetIPv4())
         SendEcho(localhost, S_ICMP_ECHO, "localhost");
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     debugs(37, 4, HERE << "Pinger handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid);
 
@@ -281,7 +281,7 @@ IcmpSquid::Close(void)
 
     debugs(37, 1, HERE << "Closing Pinger socket on FD " << icmp_sock);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     send(icmp_sock, (const void *) "$shutdown\n", 10, 0);
 
@@ -289,7 +289,7 @@ IcmpSquid::Close(void)
 
     comm_close(icmp_sock);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     if (hIpc) {
         if (WaitForSingleObject(hIpc, 12000) != WAIT_OBJECT_0) {
index bfc49a3785d4fec14dc281408355d944fcfeb638..8bcd798dec02a7cee7a9443b70eeeb2fec46eb4d 100644 (file)
@@ -72,7 +72,7 @@
 #include "Icmp6.h"
 #include "IcmpPinger.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
index 4e4cf2f62bac039547d96eed37da50f9dfbaf95a..1cfbd070adfe6c113a5ad2ef1aa6f156a0876f00 100644 (file)
@@ -646,7 +646,7 @@ icpHandleUdp(int sock, void *data)
             if (ignoreErrno(errno))
                 break;
 
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
             /* Some Linux systems seem to set the FD for reading and then
              * return ECONNREFUSED when sendto() fails and generates an ICMP
              * port unreachable message. */
index 216385f059785f03d62d65e16a7b2e57f6522cd7..15920ca901a7506803ba733379c30965eeb0fe27 100644 (file)
@@ -45,7 +45,7 @@
 #if HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #include <ws2tcpip.h>
 #endif
 #if HAVE_NETDB_H
index 184f2391e45dd60b00da8a888921975a9cd4686b..869e06b0b0310cdc4927b7e55447c873f0a08a84 100644 (file)
@@ -14,7 +14,7 @@
 class Kid
 {
 public:
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
     typedef union wait status_type;
 #else
     typedef int status_type;
index 485f1726bb64c190368342531534887c7a8a4cd0..53d09a5bf50a7b52cdc62a15d3d8b756745dccd6 100644 (file)
@@ -130,7 +130,7 @@ void WINAPI WIN32_svcHandler(DWORD);
 
 #endif
 
-#ifndef SQUID_BUILD_INFO
+#if !defined(SQUID_BUILD_INFO)
 #define SQUID_BUILD_INFO ""
 #endif
 
@@ -168,7 +168,7 @@ static void SquidShutdown(void);
 static void mainSetCwd(void);
 static int checkRunningPid(void);
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 static const char *squid_start_script = "squid_start";
 #endif
 
@@ -591,7 +591,7 @@ rotate_logs(int sig)
 {
     do_rotate = 1;
     RotateSignal = sig;
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 #if !HAVE_SIGACTION
 
     signal(sig, rotate_logs);
@@ -605,7 +605,7 @@ reconfigure(int sig)
 {
     do_reconfigure = 1;
     ReconfigureSignal = sig;
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 #if !HAVE_SIGACTION
 
     signal(sig, reconfigure);
@@ -634,7 +634,7 @@ shut_down(int sig)
                    " pid " << ppid << ": " << xstrerror());
     }
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 #if KILL_PARENT_OPT
 
     if (!IamMasterProcess() && ppid > 1) {
@@ -926,7 +926,7 @@ setEffectiveUser(void)
 {
     keepCapabilities();
     leave_suid();              /* Run as non privilegied user */
-#ifdef _SQUID_OS2_
+#if _SQUID_OS2_
 
     return;
 #endif
@@ -1010,7 +1010,7 @@ mainInitialize(void)
     setSystemLimits();
     debugs(1, 1, "With " << Squid_MaxFD << " file descriptors available");
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     debugs(1, 1, "With " << _getmaxstdio() << " CRT stdio descriptors available");
 
@@ -1534,7 +1534,7 @@ sendSignal(void)
             WIN32_sendSignal(opt_send_signal);
             exit(0);
         } else
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         {
             fprintf(stderr, "%s: ERROR: Could not send ", APP_SHORTNAME);
             fprintf(stderr, "signal to Squid Service:\n");
@@ -1569,7 +1569,7 @@ sendSignal(void)
     exit(0);
 }
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 /*
  * This function is run when Squid is in daemon mode, just
  * before the parent forks and starts up the child process.
@@ -1599,7 +1599,7 @@ mainStartScript(const char *prog)
         _exit(-1);
     } else {
         do {
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
             union wait status;
             rpid = wait4(cpid, &status, 0, NULL);
 #else
@@ -1642,9 +1642,9 @@ checkRunningPid(void)
 static void
 watch_child(char *argv[])
 {
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
     char *prog;
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
 
     union wait status;
 #else
@@ -1740,7 +1740,7 @@ watch_child(char *argv[])
 
         squid_signal(SIGINT, SIG_IGN, SA_RESTART);
 
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
 
         pid = wait3(&status, 0, NULL);
 
@@ -1773,7 +1773,7 @@ watch_child(char *argv[])
             } else {
                 syslog(LOG_NOTICE, "Squid Parent: unknown child process %d exited", pid);
             }
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
         } while ((pid = wait3(&status, WNOHANG, NULL)) > 0);
 #else
         }
index 9b49041631e6e559b9e1e59dca29055ed4e73db1..957a6aa217b626196258071b8850609bb1eecce1 100644 (file)
@@ -689,7 +689,7 @@ SQUIDCEXTERN void *leakFreeFL(void *, const char *, int);
  * prototypes for system functions missing from system includes
  */
 
-#ifdef _SQUID_SOLARIS_
+#if _SQUID_SOLARIS_
 
 SQUIDCEXTERN int getrusage(int, struct rusage *);
 SQUIDCEXTERN int getpagesize(void);
@@ -719,7 +719,7 @@ SQUIDCEXTERN void WIN32_InstallService(void);
 SQUIDCEXTERN void WIN32_RemoveService(void);
 SQUIDCEXTERN int SquidMain(int, char **);
 #endif /* _SQUID_WINDOWS_ */
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
 SQUIDCEXTERN int WIN32_pipe(int[2]);
 
index b6298c75d0a8a181d4e17c0535ed1fb893fa08fb..b55969f7dd164d58a766cc70d9be10131373f0ca 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "config.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 /** \cond AUTODOCS-IGNORE */
 using namespace Squid;
 /** \endcond */
index be55da7f4d8e34a0e1ff41705ed6e8b9e5c6c69d..88dcd29f972fa2ed658f4ab574184c4393947825 100644 (file)
@@ -36,7 +36,7 @@ Ssl::FileLocker::FileLocker(std::string const & filename)
 
 Ssl::FileLocker::~FileLocker()
 {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (hFile != INVALID_HANDLE_VALUE) {
         UnlockFile(hFile, 0, 0, 1, 0);
         CloseHandle(hFile);
@@ -258,14 +258,14 @@ void Ssl::CertificateDb::create(std::string const & db_path, int serial)
     std::string cert_full(db_path + "/" + cert_dir);
     std::string size_full(db_path + "/" + size_file);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (mkdir(db_path.c_str()))
 #else
     if (mkdir(db_path.c_str(), 0777))
 #endif
         throw std::runtime_error("Cannot create " + db_path);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     if (mkdir(cert_full.c_str()))
 #else
     if (mkdir(cert_full.c_str(), 0777))
index 0efbd7fb02e574a43d316ec80298a7647eaf4624..9b10634105bb4e11822e3234845700232d69a4d7 100644 (file)
@@ -22,7 +22,7 @@ public:
     /// Unlock file
     ~FileLocker();
 private:
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     HANDLE hFile; ///< Windows file handle.
 #else
     int fd; ///< Linux file descriptor.
index eb24fd347dd676a4067d0135a29bcc61d5aa6a3a..6ac0fd440677236e2747c0b3cb2a7de764749808 100644 (file)
@@ -153,9 +153,9 @@ int asn1timeToString(ASN1_TIME *tm, char *buf, int len);
 bool setClientSNI(SSL *ssl, const char *fqdn);
 } //namespace Ssl
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
-#ifdef __cplusplus
+#if defined(__cplusplus)
 
 /** \cond AUTODOCS-IGNORE */
 namespace Squid
index 6925700c02653cf289a3f68908034c9788b8808a..8e6ae59f2c2022c70782d58541341e0c6230ed58 100644 (file)
@@ -106,7 +106,7 @@ StoreController::createOneStore(Store &aStore)
      * The following is a workaround for create store directories sequentially
      * when running on native Windows port.
      */
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 
     if (fork())
         return;
@@ -115,7 +115,7 @@ StoreController::createOneStore(Store &aStore)
 
     aStore.create();
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 
     exit(0);
 
@@ -127,13 +127,13 @@ StoreController::create()
 {
     swapDir->create();
 
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
 
     pid_t pid;
 
     do {
         int status;
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
 
         pid = wait3(&status, WNOHANG, NULL);
 #else
index 71bbe8804ec40f83973abdbc6fefd8c19a766eca..70ac390d4f6cccc570122ce62b87c28961a38e0f 100644 (file)
@@ -72,7 +72,7 @@ extern void log_trace_init(char *);
 static void restoreCapabilities(int keep);
 int DebugSignal = -1;
 
-#ifdef _SQUID_LINUX_
+#if _SQUID_LINUX_
 /* Workaround for crappy glic header files */
 SQUIDCEXTERN int backtrace(void *, int);
 SQUIDCEXTERN void backtrace_symbols_fd(void *, int, int);
@@ -338,7 +338,7 @@ death(int sig)
         fprintf(debug_log, "FATAL: Received signal %d...dying.\n", sig);
 
 #if PRINT_STACK_TRACE
-#ifdef _SQUID_HPUX_
+#if _SQUID_HPUX_
     {
         extern void U_STACK_TRACE(void);       /* link with -lcl */
         fflush(debug_log);
@@ -558,8 +558,8 @@ debug_trap(const char *message)
 void
 sig_child(int sig)
 {
-#ifndef _SQUID_MSWIN_
-#ifdef _SQUID_NEXT_
+#if !_SQUID_MSWIN_
+#if _SQUID_NEXT_
     union wait status;
 #else
 
@@ -569,7 +569,7 @@ sig_child(int sig)
     pid_t pid;
 
     do {
-#ifdef _SQUID_NEXT_
+#if _SQUID_NEXT_
         pid = wait3(&status, WNOHANG, NULL);
 #else
 
@@ -1076,7 +1076,7 @@ squid_signal(int sig, SIGHDLR * func, int flags)
         debugs(50, 0, "sigaction: sig=" << sig << " func=" << func << ": " << xstrerror());
 
 #else
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     /*
     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 3e9a7d121a2c004217701b561e32d1ad4e74b3d9..c46e1c20fa9a5aa69761ee0c4fcab050585d7fcc 100644 (file)
@@ -142,7 +142,7 @@ unlinkdUnlink(const char *path)
 
 void
 unlinkdClose(void)
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 {
 
     if (unlinkd_wfd > -1) {
@@ -244,7 +244,7 @@ unlinkdInit(void)
 
     debugs(2, 1, "Unlinkd pipe opened on FD " << unlinkd_wfd);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     debugs(2, 4, "Unlinkd handle: 0x" << std::hex << hIpc << std::dec << ", PID: " << pid);
 
index b89b798d13787f26e9fe35f5fc901a23055b31ac..81872324be0a5da6d4afadb49dbf7fac21dc97bd 100644 (file)
@@ -36,7 +36,7 @@
 #include "squid.h"
 #include "squid_windows.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 #if HAVE_WIN32_PSAPI
 #include <psapi.h>
 #endif
index a279aaba5f3bc4a89a09d319cd04aec8c50767b1..e8c7060b2a29036c6a3bea00f3d22ef997db81d2 100644 (file)
@@ -165,7 +165,7 @@ static const char *make_auth_header(const cachemgr_request * req);
 
 static int check_target_acl(const char *hostname, int port);
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 static int s_iInitCount = 0;
 
 int Win32SockInit(void)
@@ -209,7 +209,7 @@ void Win32SockCleanup(void)
     return;
 }
 
-#endif /* ifdef _SQUID_MSWIN_ */
+#endif
 
 static const char *
 safe_str(const char *str)
@@ -577,7 +577,7 @@ static int
 read_reply(int s, cachemgr_request * req)
 {
     char buf[4 * 1024];
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     int reply;
     char *tmpfile = tempnam(NULL, "tmp0000");
@@ -601,7 +601,7 @@ read_reply(int s, cachemgr_request * req)
         parse_menu = 1;
 
     if (fp == NULL) {
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         perror(tmpfile);
         xfree(tmpfile);
 #else
@@ -613,7 +613,7 @@ read_reply(int s, cachemgr_request * req)
         return 1;
     }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     while ((reply=recv(s, buf , sizeof(buf), 0)) > 0)
         fwrite(buf, 1, reply, fp);
@@ -752,7 +752,7 @@ read_reply(int s, cachemgr_request * req)
     }
 
     fclose(fp);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     remove(tmpfile);
     xfree(tmpfile);
@@ -867,7 +867,7 @@ main(int argc, char *argv[])
     cachemgr_request *req;
 
     now = time(NULL);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     Win32SockInit();
     atexit(Win32SockCleanup);
@@ -975,7 +975,7 @@ read_request(void)
     else
         return NULL;
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
     if (strlen(buf) == 0 || strlen(buf) == 4000)
 #else
index f2fd99877aa40d5dc002a087b4a7caea04ba0d8d..41735ba255602c3ed610abf923a14e0558f6f48d 100644 (file)
@@ -38,7 +38,7 @@
 #include "rfc1123.h"
 #include "SquidTime.h"
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 /** \cond AUTODOCS-IGNORE */
 using namespace Squid;
 /** \endcond */
@@ -147,14 +147,14 @@ static struct stat sb;
 int total_bytes = 0;
 int io_timeout = 120;
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 void
 Win32SockCleanup(void)
 {
     WSACleanup();
     return;
 }
-#endif /* ifdef _SQUID_MSWIN_ */
+#endif
 
 static void
 usage(const char *progname)
@@ -385,7 +385,7 @@ main(int argc, char *argv[])
                 break;
             }
     }
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
     {
         WSADATA wsaData;
         WSAStartup(2, &wsaData);
@@ -644,7 +644,7 @@ main(int argc, char *argv[])
         if (put_file) {
             int x;
             lseek(put_fd, 0, SEEK_SET);
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
 
             while ((x = read(put_fd, buf, sizeof(buf))) > 0) {
 #else
@@ -664,7 +664,7 @@ main(int argc, char *argv[])
         }
         /* Read the data */
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         setmode(1, O_BINARY);
 
 #endif
@@ -676,7 +676,7 @@ main(int argc, char *argv[])
                 perror("client: ERROR writing to stdout");
         }
 
-#ifdef _SQUID_MSWIN_
+#if _SQUID_MSWIN_
         setmode(1, O_TEXT);
 
 #endif
@@ -822,7 +822,7 @@ set_our_signal(void)
 static ssize_t
 myread(int fd, void *buf, size_t len)
 {
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
     alarm(io_timeout);
     return read(fd, buf, len);
 #else
@@ -834,7 +834,7 @@ myread(int fd, void *buf, size_t len)
 static ssize_t
 mywrite(int fd, void *buf, size_t len)
 {
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_MSWIN_
     alarm(io_timeout);
     return write(fd, buf, len);
 #else