summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@novell.com>2011-09-18 21:46:44 +0200
committerMark Adler <madler@alumni.caltech.edu>2011-10-01 10:02:09 -0700
commit7142fcfeed453401ee47b0e36b5018a58575c065 (patch)
treeb310ac82219eedd8fdb2f8de20123d7bd39cd6df
parenta4f7c653748f5b5116e841c11af7adae7a140b88 (diff)
downloadzlib-7142fcfeed453401ee47b0e36b5018a58575c065.tar.gz
Always add large file support for windows
-rw-r--r--gzlib.c4
-rw-r--r--win32/zlib.def9
-rw-r--r--zconf.h.in6
-rw-r--r--zutil.h2
4 files changed, 17 insertions, 4 deletions
diff --git a/gzlib.c b/gzlib.c
index 57f79bb..7b31d24 100644
--- 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));
diff --git a/win32/zlib.def b/win32/zlib.def
index d2e09f2..eee109f 100644
--- a/win32/zlib.def
+++ b/win32/zlib.def
@@ -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
diff --git a/zconf.h.in b/zconf.h.in
index 1c06556..c8c2aaa 100644
--- a/zconf.h.in
+++ b/zconf.h.in
@@ -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 258fa88..c199b20 100644
--- 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