Skip to content

Commit

Permalink
Always add large file support for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Tor Lillqvist authored and madler committed Oct 1, 2011
1 parent a4f7c65 commit 7142fcf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions gzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
9 changes: 7 additions & 2 deletions win32/zlib.def
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
LIBRARY
; zlib data compression library

EXPORTS
; basic functions
zlibVersion
Expand Down Expand Up @@ -58,6 +56,13 @@ EXPORTS
gzclose_w
gzerror
gzclearerr
; large file functions
gzopen64
gzseek64
gztell64
gzoffset64
adler32_combine64
crc32_combine64
; checksum functions
adler32
crc32
Expand Down
6 changes: 5 additions & 1 deletion zconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7142fcf

Please sign in to comment.