[gs-cvs] rev 7148 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Wed Nov 1 11:58:48 PST 2006


Author: ray
Date: 2006-11-01 11:58:48 -0800 (Wed, 01 Nov 2006)
New Revision: 7148

Modified:
   trunk/gs/src/gp_mswin.c
Log:
Add prototypes for _ftelli64 and _fseeki64 for MSVC 6 builds. Allows
> 2Gb clist when building with MSVC 6. Bug 688394 for customer 330.

DETAILS:

Even though the functions are in the run time library (at least with
service pack 6), they aren't documented and aren't in the include
files. Without the prototypes, the functions are presumed to return
and 'int' so the sign gets extended for offsets > 0x7ffffff.

Tested with customer's file at 180dpi where the clist size gets up
to 2.7Gb.



Modified: trunk/gs/src/gp_mswin.c
===================================================================
--- trunk/gs/src/gp_mswin.c	2006-11-01 04:31:35 UTC (rev 7147)
+++ trunk/gs/src/gp_mswin.c	2006-11-01 19:58:48 UTC (rev 7148)
@@ -826,14 +826,19 @@
     return gp_open_printer(fname, binary_mode);
 }
 
+#if defined(_MSC_VER) && _MSC_VER < 1400
+    int64_t _ftelli64( FILE *);
+    int _fseeki64( FILE *, int64_t, int);
+#endif
+
 int64_t gp_ftell_64(FILE *strm)
 {
 #if !defined(_MSC_VER)
     return ftell(strm);
-#elif _MSC_VER < 1400
+#elif _MSC_VER < 1200
     return ftell(strm);
 #else
-    return _ftelli64(strm);
+    return (int64_t)_ftelli64(strm);
 #endif
 }
 
@@ -841,7 +846,7 @@
 {
 #if !defined(_MSC_VER)
     return fseek(strm, offset, origin);
-#elif _MSC_VER < 1400
+#elif _MSC_VER < 1200
     long offset1 = (long)offset;
     
     if (offset != offset1)



More information about the gs-cvs mailing list