cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: bagder: curl/src config-win32.h,1.14,1.15

From: Gisle Vanem <giva_at_bgnett.no>
Date: Wed, 24 Nov 2004 17:49:44 +0100

> mingw has a ftruncate() function

Okay, I was wrong. The latest MingW 3.5 has it. I had MingW 3.3.
But it's of no use when working with >2GB files. Look here:

__CRT_INLINE int ftruncate(int __fd, off_t __length)
{
  return _chsize (__fd, __length);
}

'off_t' is 32-bit and is '_chsize(int,long)'. Okay to commit this?

RCS file: /cvsroot/curl/curl/src/main.c,v
retrieving revision 1.291
diff -u -r1.291 main.c
--- main.c 14 Nov 2004 13:50:21 -0000 1.291
+++ main.c 24 Nov 2004 16:48:06 -0000
@@ -223,7 +223,7 @@
 #define _lseeki64(hnd,ofs,whence) lseek(hnd,ofs,whence)
 #endif

-static int ftruncate (int fd, curl_off_t where)
+static int curlx_ftruncate (int fd, curl_off_t where)
 {
   curl_off_t curr;
   int rc = 0;
@@ -239,6 +239,7 @@
   _lseeki64(fd, curr, SEEK_SET);
   return rc;
 }
+#define ftruncate(fd,where) curlx_ftruncate(fd,where)
 #endif

--gv
Received on 2004-11-24