--------------------- PatchSet 2471 Date: 2001/06/03 13:16:19 Author: serassio Branch: cygwin Tag: (none) Log: Added some WIN32 compatibility enhancements Members: include/config.h.in:1.3.28.1->1.3.28.2 src/disk.c:1.4.24.2->1.4.24.3 src/squid.h:1.3.22.4->1.3.22.5 src/fs/ufs/store_dir_ufs.c:1.5.10.7->1.5.10.8 Index: squid/include/config.h.in =================================================================== RCS file: /cvsroot/squid-sf//squid/include/Attic/config.h.in,v retrieving revision 1.3.28.1 retrieving revision 1.3.28.2 diff -u -r1.3.28.1 -r1.3.28.2 --- squid/include/config.h.in 14 Mar 2001 22:17:32 -0000 1.3.28.1 +++ squid/include/config.h.in 3 Jun 2001 13:16:19 -0000 1.3.28.2 @@ -1,5 +1,5 @@ /* - * $Id: config.h.in,v 1.3.28.1 2001/03/14 22:17:32 rbcollins Exp $ + * $Id: config.h.in,v 1.3.28.2 2001/06/03 13:16:19 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -107,6 +107,11 @@ #elif defined(WIN32) || defined(WINNT) || defined(__WIN32__) || defined(__WIN32) #define _SQUID_MSWIN_ +/* Some tricks for MS Compilers */ +#define setmode _setmode +#define O_TEXT _O_TEXT +#define O_BYNARY _O_BINARY + #elif defined(__APPLE__) #define _SQUID_APPLE_ Index: squid/src/disk.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/disk.c,v retrieving revision 1.4.24.2 retrieving revision 1.4.24.3 diff -u -r1.4.24.2 -r1.4.24.3 --- squid/src/disk.c 16 Apr 2001 11:55:39 -0000 1.4.24.2 +++ squid/src/disk.c 3 Jun 2001 13:16:19 -0000 1.4.24.3 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.4.24.2 2001/04/16 11:55:39 rbcollins Exp $ + * $Id: disk.c,v 1.4.24.3 2001/06/03 13:16:19 serassio Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -92,7 +92,7 @@ read_callback(-1, F->read_data); } if (F->flags.write_daemon) { -#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) +#if defined(_SQUID_MSWIN_) || defined(_SQUID_OS2_) || defined(_SQUID_CYGWIN_) /* * on some operating systems, you can not delete or rename * open files, so we won't allow delayed close. Index: squid/src/squid.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/squid.h,v retrieving revision 1.3.22.4 retrieving revision 1.3.22.5 diff -u -r1.3.22.4 -r1.3.22.5 --- squid/src/squid.h 6 May 2001 16:50:19 -0000 1.3.22.4 +++ squid/src/squid.h 3 Jun 2001 13:16:19 -0000 1.3.22.5 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.3.22.4 2001/05/06 16:50:19 serassio Exp $ + * $Id: squid.h,v 1.3.22.5 2001/06/03 13:16:19 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -484,8 +484,3 @@ #define FD_WRITE_METHOD(fd, buf, len) (*fd_table[fd].write_method)(fd, buf, len) #endif /* SQUID_H */ - -/* Some tricks for MS Compilers */ -#if defined(_SQUID_MSWIN_) -#define setmode _setmode -#endif Index: squid/src/fs/ufs/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v retrieving revision 1.5.10.7 retrieving revision 1.5.10.8 diff -u -r1.5.10.7 -r1.5.10.8 --- squid/src/fs/ufs/store_dir_ufs.c 21 May 2001 21:10:50 -0000 1.5.10.7 +++ squid/src/fs/ufs/store_dir_ufs.c 3 Jun 2001 13:16:19 -0000 1.5.10.8 @@ -860,7 +860,7 @@ char *new_path = xstrdup(storeUfsDirSwapLogFile(sd, ".new")); int fd; file_close(ufsinfo->swaplog_fd); -#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) +#if defined (_SQUID_OS2_) || defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) if (unlink(swaplog_path) < 0) { debug(50, 0) ("%s: %s\n", swaplog_path, xstrerror()); fatal("storeUfsDirCloseTmpSwapLog: unlink failed"); @@ -967,7 +967,7 @@ state->outbuf = xcalloc(CLEAN_BUF_SZ, 1); state->outbuf_offset = 0; state->walker = sd->repl->WalkInit(sd->repl); -#if !(defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_)) +#if !(defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_)) || defined (_SQUID_MSWIN_) unlink(state->new); #endif unlink(state->cln); @@ -1063,7 +1063,7 @@ fd = state->fd; /* rename */ if (state->fd >= 0) { -#if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) +#if defined(_SQUID_OS2_) || defined (_SQUID_CYGWIN_) || defined (_SQUID_MSWIN_) file_close(state->fd); state->fd = -1; if (unlink(state->cur) < 0)