]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: fix code wrappers for Cygwin and generic Win32 code
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 28 Jan 2011 07:58:53 +0000 (20:58 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 28 Jan 2011 07:58:53 +0000 (20:58 +1300)
_SQUID_WIN32_ was being used to wrap all code built specific for Windows
but with any compiler on that platform.
 - rename to _SQUID_WINDOWS_ to match OS wrpper naming convention.
 - compact several macros using verbose test: (cygwin or Ming or any)

Cleans up all affected tests to match current precompiler code style.

Also cleans up all tests involving _SQUID_CYGWN_ to match code styles.

40 files changed:
compat/os/mswin.h
compat/os/windows.h
compat/osdetect.h
helpers/basic_auth/RADIUS/basic_radius_auth.cc
helpers/basic_auth/SSPI/basic_sspi_auth.cc
helpers/basic_auth/SSPI/valid.cc
helpers/basic_auth/SSPI/valid.h
helpers/external_acl/AD_group/ext_ad_group_acl.cc
helpers/external_acl/LM_group/ext_lm_group_acl.cc
helpers/log_daemon/file/log_file_daemon.cc
include/squid_windows.h
include/sspwin32.h
lib/rfc1123.c
src/ConfigParser.cc
src/DiskIO/AIO/AIODiskFile.cc
src/DiskIO/AIO/aio_win32.cc
src/DiskIO/AIO/aio_win32.h
src/DiskIO/AIO/async_io.h
src/acl/HttpStatus.cc
src/cache_cf.cc
src/cache_diff.cc
src/cf_gen.cc
src/comm.cc
src/debug.cc
src/defines.h
src/disk.cc
src/dns_internal.cc
src/enums.h
src/eui/Eui48.cc
src/fs/coss/store_dir_coss.cc
src/fs/ufs/store_dir_ufs.cc
src/globals.h
src/icmp/Icmp4.h
src/main.cc
src/mime.cc
src/protos.h
src/squid.h
src/stat.cc
src/tools.cc
tools/squidclient.cc

index 15beb902f2d34f98282b18352c37768110f29b0d..2ba94f92c2ce09d98f79d83d72841dad8bc0d7d1 100644 (file)
@@ -34,7 +34,7 @@
 #ifndef SQUID_OS_MSWIN_H
 #define SQUID_OS_MSWIN_H
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 
 #define ACL WindowsACL
 #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */
@@ -758,5 +758,5 @@ SQUIDCEXTERN size_t getpagesize(void);
 #define PRINTF_FORMAT_ARG3
 #endif
 
-#endif /* _SQUID_WIN32_ */
+#endif /* _SQUID_WINDOWS_ */
 #endif /* SQUID_OS_MSWIN_H */
index e49fd28c9972b0e6b5d503988a33a52739ff9ad5..05d9bcc3ec32e3811ead7226b37cc0e6675197e6 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef SQUID_OS_WINDOWS_H
 #define SQUID_OS_WINDOWS_H
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 
 #ifndef ACL
 #define ACL WindowsACL
@@ -45,5 +45,5 @@
 #undef _MSWIN_ACL_WAS_NOT_DEFINED
 #endif
 
-#endif /* _SQUID_WIN32_ */
+#endif /* _SQUID_WINDOWS_ */
 #endif /* SQUID_OS_WINDOWS_H */
index e5a08904e516899a57d50654069187fdc85fadeb..26159829e402610fbb95eee4bbd2d4a43527f0a7 100644 (file)
 
 #elif defined(__CYGWIN32__)  || defined(__CYGWIN__)
 #define _SQUID_CYGWIN_ 1
-#define _SQUID_WIN32_ 1
+#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_WIN32_ 1
+#define _SQUID_WINDOWS_ 1
 
 #elif defined(__APPLE__)
 #define _SQUID_APPLE_ 1
index f6329c388c80c065bd6aea3ca9832b17d4ef4a46..81043b70d370c4c16866d2c0c0aa28809cf7808f 100644 (file)
@@ -63,7 +63,7 @@
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #include <io.h>
 #endif
 #if HAVE_CTYPE_H
index 855c973b714a128a779c4b06e5e0525245867f57..7bfcf053ef81fa7a7b61b8394b8dbf67d66efba0 100644 (file)
 #endif
 
 /* Check if we try to compile on a Windows Platform */
-#if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_)
+#if !_SQUID_WINDOWS_
+/* NON Windows Platform !!! */
+#error NON WINDOWS PLATFORM
+#endif
 
 #include "valid.h"
 
@@ -174,9 +177,3 @@ main(int argc, char **argv)
     }
     return 0;
 }
-
-#else  /* NON Windows Platform !!! */
-
-#error NON WINDOWS PLATFORM
-
-#endif
index 9e7d901c07254c7cd958bfa8acd7c2d4bd7c50f3..147ac0c5b0d07cb27e39b81358fae33bf9584322 100644 (file)
 #include "util.h"
 
 /* Check if we try to compile on a Windows Platform */
-#if defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_)
+#if !_SQUID_WINDOWS_
+/* NON Windows Platform !!! */
+#error NON WINDOWS PLATFORM
+#endif
 
-#if defined(_SQUID_CYGWIN_)
+#if _SQUID_CYGWIN_
 #include <wchar.h>
 #endif
 #include "valid.h"
@@ -175,8 +178,3 @@ Valid_User(char *UserName, char *Password, char *Group)
     }
     return result;
 }
-#else  /* NON Windows Platform !!! */
-
-#error NON WINDOWS PLATFORM
-
-#endif
index 8e8ef50b2573c36723e46b3a47ee498aab9778e9..39c599639c556f813bcaf0941bd058da76200887 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _VALID_H_
 #define _VALID_H_
 
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include <windows.h>
 #endif
 #include <lm.h>
index 9ed185fde54b88e50b29f37c36f9b34a5aea01ee..c45eefae5f3dcb3b4afbf7444de15324e547eb16 100644 (file)
@@ -61,7 +61,7 @@
 #include "helpers/defines.h"
 #include "include/util.h"
 
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include <wchar.h>
 int _wcsicmp(const wchar_t *, const wchar_t *);
 #endif
index 209d008152baef910630788dd6ee696093e0195d..5cb49c6231a7f3c3b4413acd6253e0e033cb1e8f 100644 (file)
@@ -72,7 +72,7 @@
 #include "include/util.h"
 
 
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include <wchar.h>
 int _wcsicmp(const wchar_t *, const wchar_t *);
 #endif
index 24a7af31c846087592bc11e0ec36d640d069dc81..48cd3782b96ee1df30794469371a4548ef23a547 100644 (file)
@@ -56,14 +56,14 @@ rotate(const char *path, int rotate_count)
         i--;
         snprintf(from, MAXPATHLEN, "%s.%d", path, i - 1);
         snprintf(to, MAXPATHLEN, "%s.%d", path, i);
-#if defined(_SQUID_OS2_) || defined(_SQUID_WIN32_)
+#if _SQUID_OS2_ || _SQUID_WINDOWS_
         remove(to);
 #endif
         rename(from, to);
     }
     if (rotate_count > 0) {
         snprintf(to, MAXPATHLEN, "%s.%d", path, 0);
-#if defined(_SQUID_OS2_) || defined(_SQUID_WIN32_)
+#if _SQUID_OS2_ || _SQUID_WINDOWS_
         remove(to);
 #endif
         rename(path, to);
index 5cf14de50404fdc053c3717e1b98ee3dd87f8018..b9d193b36c54550c7bfa6c200b8272d927abcc62 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef _INC_SQUID_WINDOWS_H
 #define _INC_SQUID_WINDOWS_H
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 
 #ifndef ACL
 #define ACL WindowsACL
@@ -45,6 +45,5 @@
 #undef _MSWIN_ACL_WAS_NOT_DEFINED
 #endif
 
-#endif /* _SQUID_WIN32_ */
-
+#endif /* _SQUID_WINDOWS_ */
 #endif /* _INC_SQUID_WINDOWS_H */
index bce5f82a5c295e8d22ad3601f9873fd90dc217de..d01abafdaf8ae0369df7e4433238ea712ceee5b4 100644 (file)
 #ifndef _LIBSSPWIN32_H_
 #define _LIBSSPWIN32_H_
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 
 #define SECURITY_WIN32
 #define NTLM_PACKAGE_NAME "NTLM"
 #define NEGOTIATE_PACKAGE_NAME "Negotiate"
 
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include <wchar.h>
 #define _T(x) TEXT(x)
 #else
@@ -77,6 +77,5 @@ const char * WINAPI SSP_MakeNegotiateBlob(PVOID, int, PBOOL, int *, char *);
 extern BOOL Use_Unicode;
 extern BOOL NTLM_LocalCall;
 
-#endif /* _SQUID_WIN32_ */
-
+#endif /* _SQUID_WINDOWS_ */
 #endif /* LIBSSPWIN32_H_ */
index 51accddc3c85269de590b7a105a5e46d0417dc51..7c0bdb73b205e1ccc14afbd4d77484f7c539bb58 100644 (file)
@@ -209,13 +209,7 @@ parse_rfc1123(const char *str)
     t = mktime(tm);
     if (t != -1) {
         time_t dst = 0;
-#if defined (_TIMEZONE)
-#elif defined (_timezone)
-#elif defined(_SQUID_AIX_)
-#elif defined(_SQUID_CYGWIN_)
-#elif defined(_SQUID_MSWIN_)
-#elif defined(_SQUID_SGI_)
-#else
+#if !(defined(_TIMEZONE) || defined(_timezone) || _SQUID_AIX_ || _SQUID_WINDOWS_ || _SQUID_SGI_)
     extern long timezone;
 #endif
         /*
@@ -224,7 +218,7 @@ parse_rfc1123(const char *str)
          */
         if (tm->tm_isdst > 0)
             dst = -3600;
-#if defined ( _timezone) || defined(_SQUID_WIN32_)
+#if defined(_timezone) || _SQUID_WINDOWS_
         t -= (_timezone + dst);
 #else
     t -= (timezone + dst);
index 9a7511af5d7982b1456c6cb4e6ae0143133ca532..45084b4edd64de4cf7f578f5ada2f17d2e4570dc 100644 (file)
@@ -75,9 +75,8 @@ ConfigParser::strtokFile(void)
                     return (NULL);
                 }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
                 setmode(fileno(wordFile), O_TEXT);
-
 #endif
 
                 fromFile = 1;
index 3ed4d48eb027e3758f59c4cff5a6e506120658a9..99be575f2877186d5e06d04429c18c848899273d 100644 (file)
@@ -86,7 +86,7 @@ void
 AIODiskFile::open(int flags, mode_t mode, RefCount<IORequestor> callback)
 {
     /* Simulate async calls */
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     fd = aio_open(path.termedBuf(), flags);
 #else
     fd = file_open(path.termedBuf() , flags);
@@ -232,11 +232,9 @@ void
 AIODiskFile::close ()
 {
     assert (!closed);
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     aio_close(fd);
 #else
-
     file_close(fd);
 #endif
 
index afcfdae440c5c99660e1c9ca9ed8e37c652a1e39..6f31515bef5af8c18b977b330017cb183232c575 100644 (file)
@@ -37,7 +37,7 @@
 #include "comm.h"
 #include "aio_win32.h"
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 VOID CALLBACK IoCompletionRoutine(DWORD dwErrorCode,
                                   DWORD dwNumberOfBytesTransfered, LPOVERLAPPED lpOverlapped)
 {
@@ -351,4 +351,4 @@ ssize_t aio_return64(struct aiocb64 * aiocbp)
 {
     return aiocbp->aio_sigevent.sigev_signo;
 }
-#endif /* _SQUID_WIN32_ */
+#endif /* _SQUID_WINDOWS_ */
index 28f5df80be946e270ef1cc8416b2989d30f6ce2c..cea94bacfae20dae8a088038bf6f3e171c0fed3b 100644 (file)
@@ -36,7 +36,7 @@
 
 #if USE_DISKIO_AIO
 
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include "squid_windows.h"
 #endif
 
index 94626a1fdf637662fd985f40a2454bc7c95a7e40..9eefc0891d4bc77b11a9353a7039d80b5ab41acf 100644 (file)
@@ -3,7 +3,7 @@
 
 #if USE_DISKIO_AIO
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #include "aio_win32.h"
 #else
 #if HAVE_AIO_H
index a05fb9755071ec47e3237ecf44fa37820b252c3c..2514a8cb3fb95d1cecdee75239301d6f852755ec 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "config.h"
-#ifdef _SQUID_CYGWIN_
+#if _SQUID_CYGWIN_
 #include <squid_windows.h>
 #endif
 #include "squid.h"
index 4601feb5366a3d724d8a46d5ae0edf4c782dc426..5f7fe174ffca15cc1741b40387b618930b763c62 100644 (file)
@@ -419,10 +419,8 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
     if (fp == NULL)
         fatalf("Unable to open configuration file: %s: %s", file_name, xstrerror());
 
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     SetConfigFilename(file_name, bool(is_pipe));
index 94be60f183791257704311246d68622560e9a9d8..3c50a27db23fe011d19c287c56480162fbfd173d 100644 (file)
@@ -146,9 +146,8 @@ cacheIndexAddLog(CacheIndex * idx, const char *fname)
         return 0;
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(file), O_BINARY);
-
 #endif
 
     scanned_count = cacheIndexScan(idx, fname, file);
index 95dbc5eeaf3f64fc7ad771d942d1b75bce26cba8..1f940076249edddc9f994c3f72336c291e19eb92 100644 (file)
@@ -239,7 +239,7 @@ main(int argc, char *argv[])
         exit(1);
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
 
 #endif
@@ -465,9 +465,8 @@ main(int argc, char *argv[])
         exit(1);
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     fprintf(fp,
@@ -501,9 +500,8 @@ main(int argc, char *argv[])
         exit(1);
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     gen_conf(entries, fp, 1);
@@ -514,7 +512,7 @@ main(int argc, char *argv[])
         perror(conf_filename_short);
         exit(1);
     }
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
 #endif
     gen_conf(entries, fp, 0);
index f88caff2cb65e8a944737f3ddae48d4c49da094e..b92dc8e92f1808174cafc85d1594641af30d124d 100644 (file)
@@ -62,7 +62,7 @@
 #endif
 
 #include "cbdata.h"
-#if defined(_SQUID_CYGWIN_)
+#if _SQUID_CYGWIN_
 #include <sys/ioctl.h>
 #endif
 #ifdef HAVE_NETINET_TCP_H
@@ -1661,12 +1661,10 @@ commSetNonBlocking(int fd)
     int flags;
     int dummy = 0;
 #endif
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     int nonblocking = TRUE;
 
-#ifdef _SQUID_CYGWIN_
-
+#if _SQUID_CYGWIN_
     if (fd_table[fd].type != FD_PIPE) {
 #endif
 
@@ -1675,8 +1673,7 @@ commSetNonBlocking(int fd)
             return COMM_ERROR;
         }
 
-#ifdef _SQUID_CYGWIN_
-
+#if _SQUID_CYGWIN_
     } else {
 #endif
 #endif
@@ -1693,10 +1690,8 @@ commSetNonBlocking(int fd)
         }
 
 #endif
-#ifdef _SQUID_CYGWIN_
-
+#if _SQUID_CYGWIN_
     }
-
 #endif
     fd_table[fd].flags.nonblocking = 1;
 
index 75bdeb480b038889886799ed0fe5e9f49759f594..ba79fb88621f719cdb95fffa09cdace99ff03064 100644 (file)
@@ -255,9 +255,8 @@ debugOpenLog(const char *logfile)
         debug_log = stderr;
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(debug_log), O_TEXT);
-
 #endif
 }
 
index 1496edf250c77948353d1f5bbf3cc370c4e94205..f7b283726dcc1b8fcb4c365e4afe879ee0b9a754 100644 (file)
 #define        HTTP_REQBUF_SZ  4096
 
 /* CygWin & Windows NT Port */
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #define _WIN_SQUID_SERVICE_CONTROL_STOP SERVICE_CONTROL_STOP
 #define _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_SHUTDOWN
 #define _WIN_SQUID_SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_INTERROGATE
index b2cb3cdda7959b0922391adfa445693ac2bbd710..b9b6e503f2817f95be1ab12e8075ad4d889fd96a 100644 (file)
@@ -40,7 +40,7 @@
 static PF diskHandleRead;
 static PF diskHandleWrite;
 
-#if defined(_SQUID_WIN32_) || defined(_SQUID_OS2_)
+#if _SQUID_WINDOWS_ || _SQUID_OS2_
 static int
 diskWriteIsComplete(int fd)
 {
@@ -110,25 +110,18 @@ file_close(int fd)
     }
 
     if (F->flags.write_daemon) {
-#if defined(_SQUID_WIN32_) || defined(_SQUID_OS2_)
+#if _SQUID_WINDOWS_ || _SQUID_OS2_
         /*
          * on some operating systems, you can not delete or rename
          * open files, so we won't allow delayed close.
          */
-
         while (!diskWriteIsComplete(fd))
             diskHandleWrite(fd, NULL);
-
 #else
-
         F->flags.close_request = 1;
-
         debugs(6, 2, "file_close: FD " << fd << ", delaying close");
-
         PROF_stop(file_close);
-
         return;
-
 #endif
 
     }
@@ -522,7 +515,7 @@ int
 xrename(const char *from, const char *to)
 {
     debugs(21, 2, "xrename: renaming " << from << " to " << to);
-#if defined (_SQUID_OS2_) || defined (_SQUID_WIN32_)
+#if _SQUID_OS2_ || _SQUID_WINDOWS_
     remove(to);
 #endif
 
index f859e9dcb7ad47b7a5af45e4c9600a3a7406cdc4..4e16c7274bccd50003f26148ac969db57c94bac2 100644 (file)
@@ -59,7 +59,7 @@
    using external DNS process.
  */
 #if !USE_DNSSERVERS
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #include "squid_windows.h"
 #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces"
 #define REG_TCPIP_PARA "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"
@@ -226,7 +226,7 @@ static void idnsParseNameservers(void);
 #ifndef _SQUID_MSWIN_
 static void idnsParseResolvConf(void);
 #endif
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 static void idnsParseWIN32Registry(void);
 static void idnsParseWIN32SearchList(const char *);
 #endif
@@ -364,9 +364,8 @@ idnsParseResolvConf(void)
         return;
     }
 
-#if defined(_SQUID_CYGWIN_)
+#if _SQUID_CYGWIN_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     while (fgets(buf, RESOLV_BUFSZ, fp)) {
@@ -434,7 +433,7 @@ idnsParseResolvConf(void)
 
 #endif
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 static void
 idnsParseWIN32SearchList(const char * Separator)
 {
@@ -1512,20 +1511,16 @@ idnsInit(void)
         idnsParseResolvConf();
 
 #endif
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     if (0 == nns)
         idnsParseWIN32Registry();
-
 #endif
 
     if (0 == nns) {
         debugs(78, 1, "Warning: Could not find any nameservers. Trying to use localhost");
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
         debugs(78, 1, "Please check your TCP-IP settings or /etc/resolv.conf file");
 #else
-
         debugs(78, 1, "Please check your /etc/resolv.conf file");
 #endif
 
index e5ddbfb2a34ec58dcb887c21f2faeab2b06f72dd..0e9a41113d9dcc1b295da40e4caff899581244b6 100644 (file)
@@ -326,7 +326,7 @@ enum {
 
 
 /* CygWin & Windows NT Port */
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 /*
  * Supported Windows OS types codes
  */
index 7e76de465626c53fa3a1a475b94a69f6f146f94f..b64cda26a9d76a95641429c5f9e8be99a8810709 100644 (file)
@@ -52,8 +52,7 @@
          and can be wrapped
  */
 
-#if _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
 struct arpreq {
 
     Ip::Address arp_pa;   /* protocol address */
@@ -160,9 +159,9 @@ bool
 Eui::Eui48::lookup(Ip::Address &c)
 {
     struct arpreq arpReq;
-#if !_SQUID_WIN32_
+#if !_SQUID_WINDOWS_
     struct sockaddr_in *sa = NULL;
-#endif /* !_SQUID_WIN32_ */
+#endif /* !_SQUID_WINDOWS_ */
 
     Ip::Address ipAddr = c;
     ipAddr.SetPort(0);
@@ -451,7 +450,7 @@ Eui::Eui48::lookup(Ip::Address &c)
     set(arpReq.arp_ha.sa_data, 6);
     return true;
 
-#elif _SQUID_WIN32_
+#elif _SQUID_WINDOWS_
 
     DWORD           dwNetTable = 0;
 
index 5937a0fbe72f2ee731f0f1293b1535c667864f29..025139c4018f4db8b54e3c6a73d44795d64966ce 100644 (file)
@@ -836,10 +836,9 @@ CossSwapDir::writeCleanDone()
     /* rename */
 
     if (state->fd >= 0) {
-#if defined(_SQUID_OS2_) || defined(_SQUID_WIN32_)
+#if _SQUID_OS2_ || _SQUID_WINDOWS_
         file_close(state->fd);
         state->fd = -1;
-
 #endif
 
         xrename(state->newLog, state->cur);
index 9d514f47e408573162ff420c3701ab92bc878f39..09101df3f95d822aaad0262611bd87a54b6b7ab2 100644 (file)
@@ -986,10 +986,9 @@ UFSSwapDir::writeCleanDone()
     /* rename */
 
     if (state->fd >= 0) {
-#if defined(_SQUID_OS2_) || defined (_SQUID_WIN32_)
+#if _SQUID_OS2_ || _SQUID_WINDOWS_
         file_close(state->fd);
         state->fd = -1;
-
 #endif
 
         xrename(state->newLog, state->cur);
index 3fc2007e97daacb520adfbcfc031438c39893f99..d2195f7a2b08f9c7a2f3c727c136833bacc03b98 100644 (file)
@@ -148,8 +148,7 @@ extern "C" {
 
     extern unsigned int WIN32_Socks_initialized;       /* 0 */
 #endif
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     extern unsigned int WIN32_OS_version;      /* 0 */
     extern char *WIN32_OS_string;           /* NULL */
     extern char *WIN32_Service_name;        /* NULL */
index daa34f3d3e819de1963f0bac114bca8b59b627e5..10c869f6ba17331b6e892cd7c1a0659744228ed1 100644 (file)
 #include <netinet/ip_icmp.h>
 #endif
 
-#ifndef _SQUID_LINUX_
-#ifndef _SQUID_CYGWIN_
-#ifndef _SQUID_MSWIN_
+#if !_SQUID_LINUX_ && !_SQUID_WINDOWS_
 #define icmphdr icmp
 #define iphdr ip
 #endif
-#endif
-#endif
 
 /* Linux uses its own field names. */
 #if defined (_SQUID_LINUX_)
@@ -87,8 +83,7 @@
    to use the native Windows port definitions.
  */
 
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
 #include "fde.h"
 
 #ifdef _SQUID_MSWIN_
index 662c6ef629720efee60853ef60c2d47689e33e4f..e29b7b69a20b0c8f6a3b3f70a70d6d64b5616f93 100644 (file)
@@ -966,14 +966,12 @@ mainInitialize(void)
 
     debugs(1, 0, "Starting Squid Cache version " << version_string << " for " << CONFIG_HOST_TYPE << "...");
 
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) {
         debugs(1, 0, "Running as " << WIN32_Service_name << " Windows System Service on " << WIN32_OS_string);
         debugs(1, 0, "Service command line is: " << WIN32_Service_Command_Line);
     } else
         debugs(1, 0, "Running on " << WIN32_OS_string);
-
 #endif
 
     debugs(1, 1, "Process ID " << getpid());
@@ -1240,8 +1238,7 @@ SquidMain(int argc, char **argv)
 {
     ConfigureCurrentKid(argv[0]);
 
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     int WIN32_init_err;
 #endif
 
@@ -1260,11 +1257,9 @@ SquidMain(int argc, char **argv)
 
 #endif
 
-#ifdef _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     if ((WIN32_init_err = WIN32_Subsystem_Init(&argc, &argv)))
         return WIN32_init_err;
-
 #endif
 
     /* call mallopt() before anything else */
index cf90d4c5a84a69be6d1cbf93322f316f11478709..a55801022bbb30e4949e7fbe78507036ca619b1a 100644 (file)
@@ -279,9 +279,8 @@ mimeInit(char *filename)
         return;
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     mimeFreeMemory();
index 7abeb22046373e8d855a2a38fae31e4e4a1e5bc8..599a9aa31146df60282d57e5884c74fa648a8440 100644 (file)
@@ -732,7 +732,7 @@ SQUIDCEXTERN int varyEvaluateMatch(StoreEntry * entry, HttpRequest * req);
 
 /* CygWin & Windows NT Port */
 /* win32.c */
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 SQUIDCEXTERN int WIN32_Subsystem_Init(int *, char ***);
 SQUIDCEXTERN void WIN32_sendSignal(int);
 SQUIDCEXTERN void WIN32_Abort(int);
@@ -741,7 +741,7 @@ SQUIDCEXTERN void WIN32_SetServiceCommandLine(void);
 SQUIDCEXTERN void WIN32_InstallService(void);
 SQUIDCEXTERN void WIN32_RemoveService(void);
 SQUIDCEXTERN int SquidMain(int, char **);
-#endif /* _SQUID_WIN32_ */
+#endif /* _SQUID_WINDOWS_ */
 #ifdef _SQUID_MSWIN_
 
 SQUIDCEXTERN int WIN32_pipe(int[2]);
index f73691b65139dfbcf8b59a200679ce0fbb896be6..b6298c75d0a8a181d4e17c0535ed1fb893fa08fb 100644 (file)
@@ -126,7 +126,7 @@ using namespace Squid;
 #if HAVE_LIMITS_H
 #include <limits.h>
 #endif
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #include <io.h>
 #endif
 #if HAVE_SYS_MOUNT_H
index 9ad3d0913df700949963ee029673db09827c214b..5d767cf78b03bba9565f8bb6aa2c59ea26b3e67b 100644 (file)
@@ -673,15 +673,13 @@ DumpInfo(Mgr::InfoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n",
                       version_string);
 
-#if _SQUID_WIN32_
-
+#if _SQUID_WINDOWS_
     if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) {
         storeAppendPrintf(sentry,"\nRunning as %s Windows System Service on %s\n",
                           WIN32_Service_name, WIN32_OS_string);
         storeAppendPrintf(sentry,"Service command line is: %s\n", WIN32_Service_Command_Line);
     } else
         storeAppendPrintf(sentry,"Running on %s\n",WIN32_OS_string);
-
 #endif
 
     storeAppendPrintf(sentry, "Start Time:\t%s\n",
index 18729c9bdf135eeb85310fc099403f4c5add33b2..64af91020afc3b0e7a444a9f0b627c49ce3b8e97 100644 (file)
@@ -997,7 +997,7 @@ setMaxFD(void)
 void
 setSystemLimits(void)
 {
-#if HAVE_SETRLIMIT && defined(RLIMIT_NOFILE) && !defined(_SQUID_CYGWIN_)
+#if HAVE_SETRLIMIT && defined(RLIMIT_NOFILE) && !_SQUID_CYGWIN_
     /* limit system filedescriptors to our own limit */
     struct rlimit rl;
     if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
@@ -1149,9 +1149,8 @@ parseEtcHosts(void)
         return;
     }
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
     setmode(fileno(fp), O_TEXT);
-
 #endif
 
     while (fgets(buf, 1024, fp)) {     /* for each line */
index 57e982e0f11ac22b650ac4e8348859e107eb2b5d..f70ed716641b44285675b6913c5a07ce3bb06138 100644 (file)
@@ -44,7 +44,7 @@ using namespace Squid;
 /** \endcond */
 #endif
 
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
 #include <io.h>
 #endif
 #if HAVE_STDIO_H
@@ -400,9 +400,8 @@ main(int argc, char *argv[])
                     xstrerror());
             exit(-1);
         }
-#ifdef _SQUID_WIN32_
+#if _SQUID_WINDOWS_
         setmode(put_fd, O_BINARY);
-
 #endif
 
         fstat(put_fd, &sb);