1381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* zconf.h -- configuration of the zlib compression library
209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes * Copyright (C) 1995-2012 Jean-loup Gailly.
3381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * For conditions of distribution and use, see copyright notice in zlib.h
4381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
5381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
6381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* @(#) $Id$ */
7381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
8381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZCONF_H
9381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#define ZCONF_H
10381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#cmakedefine Z_PREFIX
11381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#cmakedefine Z_HAVE_UNISTD_H
12381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
13381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/*
14381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * If you *really* need a unique prefix for all types and library functions,
15381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
16381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * Even better than compiling with -DZ_PREFIX would be to use configure to set
17381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * this permanently in zconf.h using "./configure --zprefix".
18381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
19381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
20ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define Z_PREFIX_SET
21381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
22381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* all linked symbols */
23381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _dist_code            z__dist_code
24381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _length_code          z__length_code
25381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_align             z__tr_align
26381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_flush_block       z__tr_flush_block
27381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_init              z__tr_init
28381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_stored_block      z__tr_stored_block
29381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_tally             z__tr_tally
30381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32               z_adler32
31381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32_combine       z_adler32_combine
32381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32_combine64     z_adler32_combine64
33ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
34ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compress              z_compress
35ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compress2             z_compress2
36ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compressBound         z_compressBound
37ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
38381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32                 z_crc32
39381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32_combine         z_crc32_combine
40381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32_combine64       z_crc32_combine64
41381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflate               z_deflate
42381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateBound          z_deflateBound
43381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateCopy           z_deflateCopy
44381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateEnd            z_deflateEnd
45381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateInit2_         z_deflateInit2_
46381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateInit_          z_deflateInit_
47381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateParams         z_deflateParams
48ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define deflatePending        z_deflatePending
49381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflatePrime          z_deflatePrime
50381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateReset          z_deflateReset
51ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define deflateResetKeep      z_deflateResetKeep
52381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateSetDictionary  z_deflateSetDictionary
53381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateSetHeader      z_deflateSetHeader
54381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateTune           z_deflateTune
55381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflate_copyright     z_deflate_copyright
56381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define get_crc_table         z_get_crc_table
57ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
58ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_error              z_gz_error
59ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_intmax             z_gz_intmax
60ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_strwinerror        z_gz_strwinerror
61ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzbuffer              z_gzbuffer
62ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclearerr            z_gzclearerr
63ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose               z_gzclose
64ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose_r             z_gzclose_r
65ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose_w             z_gzclose_w
66ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzdirect              z_gzdirect
67ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzdopen               z_gzdopen
68ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzeof                 z_gzeof
69ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzerror               z_gzerror
70ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzflush               z_gzflush
71ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgetc                z_gzgetc
72ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgetc_               z_gzgetc_
73ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgets                z_gzgets
74ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzoffset              z_gzoffset
75ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzoffset64            z_gzoffset64
76ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzopen                z_gzopen
77ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzopen64              z_gzopen64
7809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifdef _WIN32
7909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      define gzopen_w              z_gzopen_w
8009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
81ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzprintf              z_gzprintf
82ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzputc                z_gzputc
83ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzputs                z_gzputs
84ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzread                z_gzread
85ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzrewind              z_gzrewind
86ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzseek                z_gzseek
87ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzseek64              z_gzseek64
88ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzsetparams           z_gzsetparams
89ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gztell                z_gztell
90ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gztell64              z_gztell64
91ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzungetc              z_gzungetc
92ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzwrite               z_gzwrite
93ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
94381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate               z_inflate
95381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBack           z_inflateBack
96381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBackEnd        z_inflateBackEnd
97381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBackInit_      z_inflateBackInit_
98381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateCopy           z_inflateCopy
99381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateEnd            z_inflateEnd
100381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateGetHeader      z_inflateGetHeader
101381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateInit2_         z_inflateInit2_
102381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateInit_          z_inflateInit_
103381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateMark           z_inflateMark
104381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflatePrime          z_inflatePrime
105381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateReset          z_inflateReset
106381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateReset2         z_inflateReset2
107381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSetDictionary  z_inflateSetDictionary
108381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSync           z_inflateSync
109381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSyncPoint      z_inflateSyncPoint
110381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateUndermine      z_inflateUndermine
111ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define inflateResetKeep      z_inflateResetKeep
112381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_copyright     z_inflate_copyright
113381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_fast          z_inflate_fast
114381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_table         z_inflate_table
115ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
116ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define uncompress            z_uncompress
117ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
118381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zError                z_zError
119ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
120ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define zcalloc               z_zcalloc
121ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define zcfree                z_zcfree
122ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
123381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zlibCompileFlags      z_zlibCompileFlags
124381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zlibVersion           z_zlibVersion
125381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
126381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* all zlib typedefs in zlib.h and zconf.h */
127381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Byte                  z_Byte
128381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Bytef                 z_Bytef
129381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define alloc_func            z_alloc_func
130381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define charf                 z_charf
131381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define free_func             z_free_func
132ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
133ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzFile                z_gzFile
134ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
13509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_header             z_gz_header
13609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_headerp            z_gz_headerp
137381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define in_func               z_in_func
138381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define intf                  z_intf
139381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define out_func              z_out_func
140381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uInt                  z_uInt
141381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uIntf                 z_uIntf
142381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uLong                 z_uLong
143381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uLongf                z_uLongf
144381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidp                 z_voidp
145381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidpc                z_voidpc
146381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidpf                z_voidpf
147381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
148381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* all zlib structs in zlib.h and zconf.h */
14909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_header_s           z_gz_header_s
150381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define internal_state        z_internal_state
151381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
152381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
153381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
154381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MSDOS__) && !defined(MSDOS)
155381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MSDOS
156381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
157381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
158381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define OS2
159381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
160381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(_WINDOWS) && !defined(WINDOWS)
161381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define WINDOWS
162381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
163381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
164381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef WIN32
165381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define WIN32
166381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
167381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
168381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
169381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
170381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifndef SYS16BIT
171381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define SYS16BIT
172381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
173381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
174381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
175381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
176381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/*
177381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
178381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * than 64k bytes at a time (needed on systems with 16-bit int).
179381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
180381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SYS16BIT
181381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MAXSEG_64K
182381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
183381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef MSDOS
184381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define UNALIGNED_OK
185381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
186381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
187381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef __STDC_VERSION__
188381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef STDC
189381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define STDC
190381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
191381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if __STDC_VERSION__ >= 199901L
192381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifndef STDC99
193381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define STDC99
194381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
195381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
196381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
197381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
198381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
199381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
200381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
201381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
202381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
203381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
204381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
205381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
206381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
207381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
208381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
209381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
210381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
211381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
212381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
213381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
214381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef STDC
215381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
216381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define const       /* note: need a more gentle solution here */
217381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
218381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
219381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
220ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#if defined(ZLIB_CONST) && !defined(z_const)
221ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define z_const const
222ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#else
223ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define z_const
224ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
225ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
226381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Some Mac compilers merge all .h files incorrectly: */
227381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
228381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define NO_DUMMY_DECL
229381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
230381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
231381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Maximum value for memLevel in deflateInit2 */
232381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef MAX_MEM_LEVEL
233381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef MAXSEG_64K
234381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define MAX_MEM_LEVEL 8
235381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  else
236381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define MAX_MEM_LEVEL 9
237381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
238381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
239381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
240381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Maximum value for windowBits in deflateInit2 and inflateInit2.
241381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
242381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * created by gzip. (Files created by minigzip can still be extracted by
243381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * gzip.)
244381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
245381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef MAX_WBITS
246381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MAX_WBITS   15 /* 32K LZ77 window */
247381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
248381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
249381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* The memory requirements for deflate are (in bytes):
250381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes            (1 << (windowBits+2)) +  (1 << (memLevel+9))
251381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
252381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes plus a few kilobytes for small objects. For example, if you want to reduce
253381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes the default memory requirements from 256K to 128K, compile with
254381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
255381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes Of course this will generally degrade compression (there's no free lunch).
256381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
257381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   The memory requirements for inflate are (in bytes) 1 << windowBits
258381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes that is, 32K for windowBits=15 (default value) plus a few kilobytes
259381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes for small objects.
260381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes*/
261381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
262381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes                        /* Type declarations */
263381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
264381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef OF /* function prototypes */
265381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef STDC
266381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define OF(args)  args
267381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  else
268381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define OF(args)  ()
269381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
270381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
271381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
272ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#ifndef Z_ARG /* function prototypes for stdarg */
273ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
274ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define Z_ARG(args)  args
275ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  else
276ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define Z_ARG(args)  ()
277ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
278ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
279ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
280381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* The following definitions for FAR are needed only for MSDOS mixed
281381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * model programming (small or medium model with some far allocations).
282381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * This was tested only with MSC; for other MSDOS compilers you may have
283381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
284381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * just define FAR to be empty.
285381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
286381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SYS16BIT
287381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if defined(M_I86SM) || defined(M_I86MM)
288381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* MSC small or medium model */
289381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define SMALL_MEDIUM
290381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef _MSC_VER
291381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR _far
292381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
293381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR far
294381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
295381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
296381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if (defined(__SMALL__) || defined(__MEDIUM__))
297381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* Turbo C small or medium model */
298381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define SMALL_MEDIUM
299381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef __BORLANDC__
300381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR _far
301381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
302381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR far
303381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
304381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
305381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
306381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
307381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(WINDOWS) || defined(WIN32)
308381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* If building or using zlib as a DLL, define ZLIB_DLL.
309381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * This is not mandatory, but it offers a little performance increase.
310381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    */
311381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_DLL
312381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
313381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      ifdef ZLIB_INTERNAL
314381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#        define ZEXTERN extern __declspec(dllexport)
315381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      else
316381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#        define ZEXTERN extern __declspec(dllimport)
317381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      endif
318381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
319381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif  /* ZLIB_DLL */
320381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
321381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * define ZLIB_WINAPI.
322381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
323381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    */
324381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_WINAPI
325381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef FAR
326381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      undef FAR
327381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
328381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    include <windows.h>
329381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* No need for _export, use ZLIB.DEF instead. */
330381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
331381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define ZEXPORT WINAPI
332381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef WIN32
333381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA WINAPIV
334381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
335381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA FAR CDECL
336381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
337381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
338381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
339381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
340381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined (__BEOS__)
341381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_DLL
342381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef ZLIB_INTERNAL
343381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORT   __declspec(dllexport)
344381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA __declspec(dllexport)
345381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
346381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORT   __declspec(dllimport)
347381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA __declspec(dllimport)
348381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
349381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
350381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
351381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
352381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXTERN
353381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXTERN extern
354381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
355381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXPORT
356381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXPORT
357381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
358381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXPORTVA
359381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXPORTVA
360381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
361381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
362381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef FAR
363381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define FAR
364381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
365381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
366381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(__MACTYPES__)
367381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned char  Byte;  /* 8 bits */
368381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
369381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned int   uInt;  /* 16 bits or more */
370381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned long  uLong; /* 32 bits or more */
371381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
372381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SMALL_MEDIUM
373381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
374381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Bytef Byte FAR
375381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
376381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte  FAR Bytef;
377381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
378381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef char  FAR charf;
379381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef int   FAR intf;
380381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef uInt  FAR uIntf;
381381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef uLong FAR uLongf;
382381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
383381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef STDC
384381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void const *voidpc;
385381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void FAR   *voidpf;
386381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void       *voidp;
387381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
388381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte const *voidpc;
389381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte FAR   *voidpf;
390381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte       *voidp;
391381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
392381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
39309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes/* ./configure may #define Z_U4 here */
39409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
39509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
39609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  include <limits.h>
39709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  if (UINT_MAX == 0xffffffffUL)
39809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    define Z_U4 unsigned
39909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  else
40009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    if (ULONG_MAX == 0xffffffffUL)
40109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      define Z_U4 unsigned long
40209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    else
40309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      if (USHRT_MAX == 0xffffffffUL)
40409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#        define Z_U4 unsigned short
40509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      endif
40609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
40709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  endif
40809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
40909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
41009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifdef Z_U4
41109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes   typedef Z_U4 z_crc_t;
41209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#else
41309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes   typedef unsigned long z_crc_t;
41409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
41509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
416381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
417381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Z_HAVE_UNISTD_H
418381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
419381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
420ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
421ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define Z_HAVE_STDARG_H
422ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
423ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
424381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef STDC
425ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
426ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    include <sys/types.h>      /* for off_t */
427ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
428381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
429381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
43009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifdef _WIN32
43109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  include <stddef.h>           /* for wchar_t */
43209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
43309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
434381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
435381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
436381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * though the former does not conform to the LFS document), but considering
437381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
438381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * equivalently requesting no 64-bit operations
439381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
44009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
441381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  undef _LARGEFILE64_SOURCE
442381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
443381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
44409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
44509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_HAVE_UNISTD_H
446ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
44709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifndef Z_SOLO
44809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  if defined(Z_HAVE_UNISTD_H) || defined(LARGEFILE64_SOURCE)
44909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
45009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifdef VMS
45109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      include <unixio.h>       /* for off_t */
45209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
45309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifndef z_off_t
45409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      define z_off_t off_t
45509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
456381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
457381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
458381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
45909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
46009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_LFS64
46109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
46209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
46309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
46409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_LARGE64
46509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
46609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
46709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
46809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_WANT64
46909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
47009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
471ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#if !defined(SEEK_SET) && !defined(Z_SOLO)
472381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_SET        0       /* Seek from beginning of file.  */
473381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_CUR        1       /* Seek from current position.  */
474381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
475381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
476381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
477381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef z_off_t
478381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define z_off_t long
479381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
480381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
48109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if !defined(_WIN32) && defined(Z_LARGE64)
482381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define z_off64_t off64_t
483381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
48409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
485ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define z_off64_t __int64
486ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  else
48709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    define z_off64_t z_off_t
48809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  endif
489381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
490381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
491381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* MVS linker does not support external names larger than 8 bytes */
492381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MVS__)
493381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateInit_,"DEIN")
494381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateInit2_,"DEIN2")
495381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateEnd,"DEEND")
496381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateBound,"DEBND")
497381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateInit_,"ININ")
498381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateInit2_,"ININ2")
499381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateEnd,"INEND")
500381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateSync,"INSY")
501381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateSetDictionary,"INSEDI")
502381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(compressBound,"CMBND")
503381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_table,"INTABL")
504381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_fast,"INFA")
505381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_copyright,"INCOPY")
506381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
507381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
508381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif /* ZCONF_H */
509