]> git.lizzy.rs Git - zlib.git/commitdiff
Always add large file support for windows
authorTor Lillqvist <tlillqvist@novell.com>
Sun, 18 Sep 2011 19:46:44 +0000 (21:46 +0200)
committerMark Adler <madler@alumni.caltech.edu>
Sat, 1 Oct 2011 17:02:09 +0000 (10:02 -0700)
gzlib.c
win32/zlib.def
zconf.h.in
zutil.h

diff --git a/gzlib.c b/gzlib.c
index 57f79bb8c50b86bac2aea30a23e223f6ebb7f051..7b31d2432658a492d8c68d8189feffa2b8de20e3 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -5,11 +5,15 @@
 
 #include "gzguts.h"
 
+#if defined(_WIN32)
+#  define LSEEK _lseeki64
+#else
 #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
 #  define LSEEK lseek64
 #else
 #  define LSEEK lseek
 #endif
+#endif
 
 /* Local functions */
 local void gz_reset OF((gz_statep));
index d2e09f214431c50b533948c0d6b0ff3e00b2a43a..eee109fc7aec8900684891335f4e9d4dfdd8f764 100644 (file)
@@ -1,6 +1,4 @@
-LIBRARY
 ; zlib data compression library
-
 EXPORTS
 ; basic functions
     zlibVersion
@@ -58,6 +56,13 @@ EXPORTS
     gzclose_w
     gzerror
     gzclearerr
+; large file functions
+    gzopen64
+    gzseek64
+    gztell64
+    gzoffset64
+    adler32_combine64
+    crc32_combine64
 ; checksum functions
     adler32
     crc32
index 1c06556ef6e6031858a1d81c50354f776436c3d9..c8c2aaadd590e92b1fd3849e43ded1e1589fb4fb 100644 (file)
@@ -412,11 +412,15 @@ typedef uLong FAR uLongf;
 #  define z_off_t long
 #endif
 
-#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
+#if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
 #  define z_off64_t off64_t
 #else
+#  if defined(_WIN32)
+#    define z_off64_t __int64
+#  else
 #  define z_off64_t z_off_t
 #endif
+#endif
 
 #if defined(__OS400__)
 #  define NO_vsnprintf
diff --git a/zutil.h b/zutil.h
index 258fa88799ad1d97e44fe1ac9df77948e82ea5c0..c199b20148a36dddd58c7ecf34efd6d14cba8ba4 100644 (file)
--- a/zutil.h
+++ b/zutil.h
@@ -160,7 +160,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #endif
 
 /* provide prototypes for these when building zlib without LFS */
-#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+#if !defined(_WIN32) && (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
 #endif