------------------------------------------------------------ revno: 12261 revision-id: squid3@treenet.co.nz-20120808080146-ugq1744dvm8lklsg parent: squid3@treenet.co.nz-20120808073935-zg0yhebhl40zgi79 committer: Amos Jeffries branch nick: trunk timestamp: Wed 2012-08-08 20:01:46 +1200 message: Windows: MinGW provides truncate()/ftruncate() ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20120808080146-ugq1744dvm8lklsg # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 3dd44f4ce09628f3995c9b4a4b60f8be5b207482 # timestamp: 2012-08-08 08:17:05 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20120808073935-\ # zg0yhebhl40zgi79 # # Begin patch === modified file 'compat/mswin.cc' --- compat/mswin.cc 2012-01-20 18:55:04 +0000 +++ compat/mswin.cc 2012-08-08 08:01:46 +0000 @@ -236,6 +236,7 @@ return 0; } +#if !_SQUID_MINGW_ int WIN32_ftruncate(int fd, off_t size) { @@ -283,6 +284,7 @@ return res; } +#endif /* !_SQUID_MINGW_ */ struct passwd * getpwnam(char *unused) { === modified file 'compat/os/mswin.h' --- compat/os/mswin.h 2012-08-08 07:21:13 +0000 +++ compat/os/mswin.h 2012-08-08 08:01:46 +0000 @@ -90,7 +90,12 @@ #define fileno _fileno #define fstat _fstati64 #endif +#if !defined(_SQUID_MINGW_) // MinGW defines these properly +SQUIDCEXTERN int WIN32_ftruncate(int fd, off_t size); #define ftruncate WIN32_ftruncate +SQUIDCEXTERN int WIN32_truncate(const char *pathname, off_t length); +#define truncate WIN32_truncate +#endif #define getcwd _getcwd #define getpid _getpid #define getrusage WIN32_getrusage @@ -115,7 +120,6 @@ #define strncasecmp _strnicmp #define tempnam _tempnam #endif -#define truncate WIN32_truncate #define umask _umask #define unlink _unlink #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ === modified file 'include/util.h' --- include/util.h 2012-06-04 10:00:44 +0000 +++ include/util.h 2012-08-08 08:01:46 +0000 @@ -115,13 +115,11 @@ /* win32lib.c */ #if _SQUID_MSWIN_ SQUIDCEXTERN int chroot (const char *); -SQUIDCEXTERN int ftruncate(int, off_t); #if !HAVE_GETTIMEOFDAY SQUIDCEXTERN int gettimeofday(struct timeval * ,void *); #endif SQUIDCEXTERN int kill(pid_t, int); SQUIDCEXTERN int statfs(const char *, struct statfs *); -SQUIDCEXTERN int truncate(const char *, off_t); SQUIDCEXTERN struct passwd *getpwnam(char *); SQUIDCEXTERN struct group *getgrnam(char *); SQUIDCEXTERN uid_t geteuid(void);