From: hno <> Date: Thu, 24 Apr 2003 12:35:03 +0000 (+0000) Subject: From Guido (with additions by me): X-Git-Tag: SQUID_3_0_PRE1~237 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec4daaa538f00626ef8373251be80151e7f54455;p=thirdparty%2Fsquid.git From Guido (with additions by me): - new _SQUID_WIN32_ define instead of (_SQUID_CYGWIN_) || (_SQUID_MSWIN_) --- diff --git a/include/config.h b/include/config.h index 78db763474..bf91ebbec6 100644 --- a/include/config.h +++ b/include/config.h @@ -1,5 +1,5 @@ /* - * $Id: config.h,v 1.8 2003/01/23 00:36:47 robertc Exp $ + * $Id: config.h,v 1.9 2003/04/24 06:35:03 hno Exp $ * * AUTHOR: Duane Wessels * @@ -110,9 +110,11 @@ #elif defined(__CYGWIN32__) || defined(__CYGWIN__) #define _SQUID_CYGWIN_ +#define _SQUID_WIN32_ #elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) #define _SQUID_MSWIN_ +#define _SQUID_WIN32_ #elif defined(__APPLE__) #define _SQUID_APPLE_ diff --git a/lib/rfc1123.c b/lib/rfc1123.c index 42263ecad7..2b7503e92b 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -1,6 +1,6 @@ /* - * $Id: rfc1123.c,v 1.32 2003/02/03 21:33:15 robertc Exp $ + * $Id: rfc1123.c,v 1.33 2003/04/24 06:35:04 hno Exp $ * * DEBUG: * AUTHOR: Harvest Derived @@ -270,7 +270,7 @@ parse_rfc1123(const char *str) */ if (tm->tm_isdst > 0) dst = -3600; -#if defined ( _timezone) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) +#if defined ( _timezone) || defined(_SQUID_WIN32_) t -= (_timezone + dst); #else t -= (timezone + dst); diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 7c3039e9c7..d9129be259 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.439 2003/04/17 15:25:43 hno Exp $ + * $Id: cache_cf.cc,v 1.440 2003/04/24 06:35:04 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -294,7 +294,7 @@ parseConfigFile(const char *file_name) fatalf("Unable to open configuration file: %s: %s", file_name, xstrerror()); -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); @@ -3043,7 +3043,7 @@ strtok_again: return (NULL); } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(wordFile), O_TEXT); #endif diff --git a/src/cache_diff.cc b/src/cache_diff.cc index 00ba8800b0..38b2ea01ce 100644 --- a/src/cache_diff.cc +++ b/src/cache_diff.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_diff.cc,v 1.18 2003/02/21 22:50:06 robertc Exp $ + * $Id: cache_diff.cc,v 1.19 2003/04/24 06:35:08 hno Exp $ * * AUTHOR: Alex Rousskov * @@ -153,7 +153,7 @@ cacheIndexAddLog(CacheIndex * idx, const char *fname) return 0; } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(file), O_BINARY); #endif diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 592d5c4364..078e0259b0 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -1,6 +1,6 @@ /* - * $Id: cf_gen.cc,v 1.50 2003/02/21 22:50:07 robertc Exp $ + * $Id: cf_gen.cc,v 1.51 2003/04/24 06:35:08 hno Exp $ * * DEBUG: none Generate squid.conf.default and cf_parser.h * AUTHOR: Max Okumoto @@ -66,7 +66,7 @@ #if HAVE_ASSERT_H #include #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ #include #endif #if HAVE_FCNTL_H @@ -178,7 +178,7 @@ main(int argc, char *argv[]) exit(1); } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); #endif @@ -404,7 +404,7 @@ main(int argc, char *argv[]) exit(1); } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); #endif @@ -438,7 +438,7 @@ main(int argc, char *argv[]) exit(1); } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); #endif diff --git a/src/client.cc b/src/client.cc index 04936efb3d..bb8ae35ba3 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1,6 +1,6 @@ /* - * $Id: client.cc,v 1.105 2003/02/21 22:50:07 robertc Exp $ + * $Id: client.cc,v 1.106 2003/04/24 06:35:08 hno Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived @@ -283,7 +283,7 @@ main(int argc, char *argv[]) exit(-1); } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(put_fd, O_BINARY); #endif diff --git a/src/comm.cc b/src/comm.cc index 044b82f311..4a270de0b7 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.373 2003/04/20 05:28:58 robertc Exp $ + * $Id: comm.cc,v 1.374 2003/04/24 06:35:08 hno Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -1961,7 +1961,7 @@ commSetNonBlocking(int fd) int flags; int dummy = 0; #endif -#if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) +#ifdef _SQUID_WIN32_ int nonblocking = TRUE; @@ -1985,7 +1985,7 @@ commSetNonBlocking(int fd) } #endif -#if defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) +#ifdef _SQUID_WIN32_ } diff --git a/src/debug.cc b/src/debug.cc index 37498b74d8..f21175c4d1 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,6 +1,6 @@ /* - * $Id: debug.cc,v 1.89 2003/02/21 22:50:07 robertc Exp $ + * $Id: debug.cc,v 1.90 2003/04/24 06:35:08 hno Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -224,7 +224,7 @@ debugOpenLog(const char *logfile) { debug_log = stderr; } -#if defined(_SQUID_CYGWIN_)||defined(_SQUID_MSWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(debug_log), O_TEXT); #endif diff --git a/src/defines.h b/src/defines.h index 4e21e71b83..ba50b834f5 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.113 2003/04/20 05:28:58 robertc Exp $ + * $Id: defines.h,v 1.114 2003/04/24 06:35:08 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -312,7 +312,7 @@ #define HTTP_REQBUF_SZ 4096 /* CygWin & Windows NT Port */ -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ #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 diff --git a/src/disk.cc b/src/disk.cc index 815f220b3b..80572a5338 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,6 +1,6 @@ /* - * $Id: disk.cc,v 1.164 2003/02/21 22:50:08 robertc Exp $ + * $Id: disk.cc,v 1.165 2003/04/24 06:35:08 hno Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -39,7 +39,7 @@ static PF diskHandleRead; static PF diskHandleWrite; -#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) +#if defined(_SQUID_WIN32_) || defined(_SQUID_OS2_) static int diskWriteIsComplete(int fd) { @@ -106,7 +106,7 @@ file_close(int fd) } if (F->flags.write_daemon) { -#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) +#if defined(_SQUID_WIN32_) || defined(_SQUID_OS2_) /* * on some operating systems, you can not delete or rename * open files, so we won't allow delayed close. diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 0cddc36865..20bf511861 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.58 2003/04/22 15:06:09 hno Exp $ + * $Id: dns_internal.cc,v 1.59 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -42,7 +42,7 @@ using external DNS process. */ #ifndef USE_DNSSERVERS -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ #include "squid_windows.h" #endif #ifndef _PATH_RESOLV_CONF @@ -99,7 +99,7 @@ static void idnsParseNameservers(void); #ifndef _SQUID_MSWIN_ static void idnsParseResolvConf(void); #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ static void idnsParseWIN32Registry(void); #endif static void idnsSendQuery(idns_query * q); @@ -217,7 +217,7 @@ idnsParseResolvConf(void) #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ static void idnsParseWIN32Registry(void) { @@ -798,7 +798,7 @@ idnsInit(void) idnsParseResolvConf(); #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ if (0 == nns) idnsParseWIN32Registry(); @@ -807,7 +807,7 @@ idnsInit(void) if (0 == nns) fatal("Could not find any nameservers.\n" -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ " Please check your TCP-IP settings or /etc/resolv.conf file\n" #else " Please check your /etc/resolv.conf file\n" diff --git a/src/enums.h b/src/enums.h index 5584377290..f8d5ae6f85 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.230 2003/03/10 04:56:38 robertc Exp $ + * $Id: enums.h,v 1.231 2003/04/24 06:35:09 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -708,7 +708,7 @@ typedef enum { /* CygWin & Windows NT Port */ -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ /* * Supported Windows OS types codes */ diff --git a/src/fs/ufs/store_dir_ufs.cc b/src/fs/ufs/store_dir_ufs.cc index 480c4684c5..74b82e524d 100644 --- a/src/fs/ufs/store_dir_ufs.cc +++ b/src/fs/ufs/store_dir_ufs.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir_ufs.cc,v 1.57 2003/03/06 06:21:41 robertc Exp $ + * $Id: store_dir_ufs.cc,v 1.58 2003/04/24 06:35:10 hno Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -773,7 +773,7 @@ UFSSwapDir::closeTmpSwapLog() char *new_path = xstrdup(logFile(".new")); int fd; file_close(swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) +#if defined (_SQUID_OS2_) || defined (_SQUID_WIN32_) if (::unlink(swaplog_path) < 0) { debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); @@ -1020,7 +1020,7 @@ UFSSwapDir::writeCleanDone() /* rename */ if (state->fd >= 0) { -#if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_) +#if defined(_SQUID_OS2_) || defined (_SQUID_WIN32_) file_close(state->fd); state->fd = -1; diff --git a/src/globals.h b/src/globals.h index 1a7b503b90..e0366070c5 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.123 2003/04/22 15:06:09 hno Exp $ + * $Id: globals.h,v 1.124 2003/04/24 06:35:09 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -160,7 +160,7 @@ extern int incoming_sockets_accepted; #ifdef _SQUID_MSWIN_ extern unsigned int WIN32_Socks_initialized; /* 0 */ #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ extern unsigned int WIN32_OS_version; /* 0 */ extern char *WIN32_OS_string; /* NULL */ extern char *WIN32_Service_name; /* NULL */ diff --git a/src/main.cc b/src/main.cc index f935236603..99eef49806 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.372 2003/04/22 15:06:10 hno Exp $ + * $Id: main.cc,v 1.373 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -607,7 +607,7 @@ mainInitialize(void) version_string, CONFIG_HOST_TYPE); -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { debug(1, 0) ("Running as %s Windows System Service on %s\n", WIN32_Service_name, WIN32_OS_string); @@ -764,7 +764,7 @@ main(int argc, char **argv) int errcount = 0; int n; /* # of GC'd objects */ mode_t oldmask; -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ int WIN32_init_err; #endif @@ -779,7 +779,7 @@ main(int argc, char **argv) if (FD_SETSIZE < Squid_MaxFD) Squid_MaxFD = FD_SETSIZE; -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ if ((WIN32_init_err = WIN32_Subsystem_Init())) return WIN32_init_err; diff --git a/src/mime.cc b/src/mime.cc index 66a592edb7..acee3acd17 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,6 +1,6 @@ /* - * $Id: mime.cc,v 1.111 2003/02/21 22:50:10 robertc Exp $ + * $Id: mime.cc,v 1.112 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -421,7 +421,7 @@ mimeInit(char *filename) return; } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); #endif diff --git a/src/pinger.cc b/src/pinger.cc index dbc1c3c894..68800b9a5c 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $Id: pinger.cc,v 1.51 2003/02/23 00:08:04 robertc Exp $ + * $Id: pinger.cc,v 1.52 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -42,7 +42,7 @@ to use the native Windows port definitions. */ -#if !defined(_SQUID_MSWIN_) && !defined(_SQUID_CYGWIN_) +#ifndef _SQUID_WIN32_ #include #include @@ -54,7 +54,7 @@ static int socket_from_squid = 0; static int socket_to_squid = 1; -#else /* _SQUID_MSWIN_ or _SQUID_CYGWIN_ */ +#else /* _SQUID_WIN32_ */ #ifdef _SQUID_MSWIN_ diff --git a/src/protos.h b/src/protos.h index 5ab1b704b0..9fff7822e1 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.476 2003/04/21 12:52:40 hno Exp $ + * $Id: protos.h,v 1.477 2003/04/24 06:35:09 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1069,7 +1069,7 @@ SQUIDCEXTERN int varyEvaluateMatch(StoreEntry * entry, request_t * req); /* CygWin & Windows NT Port */ /* win32.c */ -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ #ifdef USE_WIN32_SERVICE SQUIDCEXTERN int WIN32_Subsystem_Init(int *, char ***); #else @@ -1081,7 +1081,7 @@ SQUIDCEXTERN void WIN32_Exit(void); SQUIDCEXTERN void WIN32_SetServiceCommandLine(void); SQUIDCEXTERN void WIN32_InstallService(void); SQUIDCEXTERN void WIN32_RemoveService(void); -#endif +#endif /* _SQUID_WIN32_ */ #ifdef _SQUID_MSWIN_ SQUIDCEXTERN int WIN32_getrusage(int, struct rusage *); diff --git a/src/squid.h b/src/squid.h index abc6bf1bc4..cb668974ff 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.233 2003/04/20 05:29:00 robertc Exp $ + * $Id: squid.h,v 1.234 2003/04/24 06:35:09 hno Exp $ * * AUTHOR: Duane Wessels * @@ -146,7 +146,7 @@ #if HAVE_LIMITS_H #include #endif -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ #include #endif diff --git a/src/stat.cc b/src/stat.cc index b8945481a2..3fb08e74bf 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.373 2003/04/22 15:06:10 hno Exp $ + * $Id: stat.cc,v 1.374 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -455,7 +455,7 @@ info_get(StoreEntry * sentry) storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n", version_string); -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { storeAppendPrintf(sentry,"\nRunning as %s Windows System Service on %s\n", diff --git a/src/tools.cc b/src/tools.cc index 94db68d335..38d2052723 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.234 2003/04/20 05:29:00 robertc Exp $ + * $Id: tools.cc,v 1.235 2003/04/24 06:35:09 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1170,7 +1170,7 @@ parseEtcHosts(void) return; } -#if defined(_SQUID_MSWIN_) || defined(_SQUID_CYGWIN_) +#ifdef _SQUID_WIN32_ setmode(fileno(fp), O_TEXT); #endif