1381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* zconf.h -- configuration of the zlib compression library
204351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes * Copyright (C) 1995-2013 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
2604351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  define _tr_flush_bits        z__tr_flush_bits
27381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_flush_block       z__tr_flush_block
28381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_init              z__tr_init
29381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_stored_block      z__tr_stored_block
30381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define _tr_tally             z__tr_tally
31381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32               z_adler32
32381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32_combine       z_adler32_combine
33381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define adler32_combine64     z_adler32_combine64
34ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
35ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compress              z_compress
36ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compress2             z_compress2
37ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define compressBound         z_compressBound
38ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
39381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32                 z_crc32
40381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32_combine         z_crc32_combine
41381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define crc32_combine64       z_crc32_combine64
42381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflate               z_deflate
43381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateBound          z_deflateBound
44381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateCopy           z_deflateCopy
45381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateEnd            z_deflateEnd
46381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateInit2_         z_deflateInit2_
47381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateInit_          z_deflateInit_
48381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateParams         z_deflateParams
49ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define deflatePending        z_deflatePending
50381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflatePrime          z_deflatePrime
51381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateReset          z_deflateReset
52ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define deflateResetKeep      z_deflateResetKeep
53381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateSetDictionary  z_deflateSetDictionary
54381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateSetHeader      z_deflateSetHeader
55381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflateTune           z_deflateTune
56381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define deflate_copyright     z_deflate_copyright
57381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define get_crc_table         z_get_crc_table
58ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
59ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_error              z_gz_error
60ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_intmax             z_gz_intmax
61ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gz_strwinerror        z_gz_strwinerror
62ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzbuffer              z_gzbuffer
63ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclearerr            z_gzclearerr
64ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose               z_gzclose
65ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose_r             z_gzclose_r
66ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzclose_w             z_gzclose_w
67ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzdirect              z_gzdirect
68ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzdopen               z_gzdopen
69ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzeof                 z_gzeof
70ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzerror               z_gzerror
71ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzflush               z_gzflush
72ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgetc                z_gzgetc
73ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgetc_               z_gzgetc_
74ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzgets                z_gzgets
75ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzoffset              z_gzoffset
76ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzoffset64            z_gzoffset64
77ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzopen                z_gzopen
78ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzopen64              z_gzopen64
7909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifdef _WIN32
8009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      define gzopen_w              z_gzopen_w
8109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
82ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzprintf              z_gzprintf
8304351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#    define gzvprintf             z_gzvprintf
84ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzputc                z_gzputc
85ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzputs                z_gzputs
86ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzread                z_gzread
87ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzrewind              z_gzrewind
88ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzseek                z_gzseek
89ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzseek64              z_gzseek64
90ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzsetparams           z_gzsetparams
91ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gztell                z_gztell
92ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gztell64              z_gztell64
93ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzungetc              z_gzungetc
94ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzwrite               z_gzwrite
95ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
96381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate               z_inflate
97381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBack           z_inflateBack
98381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBackEnd        z_inflateBackEnd
99381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateBackInit_      z_inflateBackInit_
100381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateCopy           z_inflateCopy
101381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateEnd            z_inflateEnd
102381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateGetHeader      z_inflateGetHeader
103381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateInit2_         z_inflateInit2_
104381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateInit_          z_inflateInit_
105381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateMark           z_inflateMark
106381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflatePrime          z_inflatePrime
107381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateReset          z_inflateReset
108381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateReset2         z_inflateReset2
109381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSetDictionary  z_inflateSetDictionary
11004351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  define inflateGetDictionary  z_inflateGetDictionary
111381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSync           z_inflateSync
112381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateSyncPoint      z_inflateSyncPoint
113381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflateUndermine      z_inflateUndermine
114ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define inflateResetKeep      z_inflateResetKeep
115381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_copyright     z_inflate_copyright
116381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_fast          z_inflate_fast
117381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define inflate_table         z_inflate_table
118ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
119ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define uncompress            z_uncompress
120ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
121381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zError                z_zError
122ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
123ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define zcalloc               z_zcalloc
124ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define zcfree                z_zcfree
125ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
126381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zlibCompileFlags      z_zlibCompileFlags
127381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define zlibVersion           z_zlibVersion
128381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
129381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* all zlib typedefs in zlib.h and zconf.h */
130381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Byte                  z_Byte
131381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Bytef                 z_Bytef
132381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define alloc_func            z_alloc_func
133381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define charf                 z_charf
134381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define free_func             z_free_func
135ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
136ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define gzFile                z_gzFile
137ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
13809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_header             z_gz_header
13909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_headerp            z_gz_headerp
140381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define in_func               z_in_func
141381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define intf                  z_intf
142381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define out_func              z_out_func
143381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uInt                  z_uInt
144381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uIntf                 z_uIntf
145381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uLong                 z_uLong
146381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define uLongf                z_uLongf
147381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidp                 z_voidp
148381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidpc                z_voidpc
149381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define voidpf                z_voidpf
150381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
151381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* all zlib structs in zlib.h and zconf.h */
15209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define gz_header_s           z_gz_header_s
153381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define internal_state        z_internal_state
154381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
155381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
156381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
157381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MSDOS__) && !defined(MSDOS)
158381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MSDOS
159381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
160381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
161381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define OS2
162381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
163381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(_WINDOWS) && !defined(WINDOWS)
164381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define WINDOWS
165381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
166381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
167381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef WIN32
168381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define WIN32
169381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
170381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
171381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
172381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
173381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifndef SYS16BIT
174381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define SYS16BIT
175381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
176381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
177381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
178381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
179381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/*
180381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
181381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * than 64k bytes at a time (needed on systems with 16-bit int).
182381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
183381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SYS16BIT
184381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MAXSEG_64K
185381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
186381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef MSDOS
187381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define UNALIGNED_OK
188381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
189381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
190381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef __STDC_VERSION__
191381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef STDC
192381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define STDC
193381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
194381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if __STDC_VERSION__ >= 199901L
195381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifndef STDC99
196381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define STDC99
197381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
198381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
199381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
200381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
201381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
202381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
203381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
204381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
205381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
206381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
207381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
208381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
209381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
210381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
211381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
212381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
213381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
214381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define STDC
215381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
216381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
217381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef STDC
218381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
219381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define const       /* note: need a more gentle solution here */
220381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
221381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
222381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
223ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#if defined(ZLIB_CONST) && !defined(z_const)
224ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define z_const const
225ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#else
226ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define z_const
227ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
228ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
229381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Some Mac compilers merge all .h files incorrectly: */
230381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
231381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define NO_DUMMY_DECL
232381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
233381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
234381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Maximum value for memLevel in deflateInit2 */
235381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef MAX_MEM_LEVEL
236381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef MAXSEG_64K
237381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define MAX_MEM_LEVEL 8
238381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  else
239381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define MAX_MEM_LEVEL 9
240381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
241381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
242381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
243381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* Maximum value for windowBits in deflateInit2 and inflateInit2.
244381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
245381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * created by gzip. (Files created by minigzip can still be extracted by
246381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * gzip.)
247381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
248381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef MAX_WBITS
249381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define MAX_WBITS   15 /* 32K LZ77 window */
250381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
251381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
252381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* The memory requirements for deflate are (in bytes):
253381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes            (1 << (windowBits+2)) +  (1 << (memLevel+9))
254381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
255381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes plus a few kilobytes for small objects. For example, if you want to reduce
256381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes the default memory requirements from 256K to 128K, compile with
257381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
258381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes Of course this will generally degrade compression (there's no free lunch).
259381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
260381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   The memory requirements for inflate are (in bytes) 1 << windowBits
261381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes that is, 32K for windowBits=15 (default value) plus a few kilobytes
262381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes for small objects.
263381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes*/
264381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
265381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes                        /* Type declarations */
266381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
267381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef OF /* function prototypes */
268381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef STDC
269381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define OF(args)  args
270381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  else
271381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define OF(args)  ()
272381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
273381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
274381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
275ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#ifndef Z_ARG /* function prototypes for stdarg */
276ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
277ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define Z_ARG(args)  args
278ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  else
279ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define Z_ARG(args)  ()
280ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
281ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
282ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
283381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* The following definitions for FAR are needed only for MSDOS mixed
284381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * model programming (small or medium model with some far allocations).
285381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * This was tested only with MSC; for other MSDOS compilers you may have
286381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
287381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * just define FAR to be empty.
288381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
289381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SYS16BIT
290381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if defined(M_I86SM) || defined(M_I86MM)
291381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* MSC small or medium model */
292381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define SMALL_MEDIUM
293381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef _MSC_VER
294381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR _far
295381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
296381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR far
297381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
298381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
299381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  if (defined(__SMALL__) || defined(__MEDIUM__))
300381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* Turbo C small or medium model */
301381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define SMALL_MEDIUM
302381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef __BORLANDC__
303381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR _far
304381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
305381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define FAR far
306381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
307381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
308381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
309381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
310381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(WINDOWS) || defined(WIN32)
311381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* If building or using zlib as a DLL, define ZLIB_DLL.
312381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * This is not mandatory, but it offers a little performance increase.
313381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    */
314381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_DLL
315381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
316381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      ifdef ZLIB_INTERNAL
317381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#        define ZEXTERN extern __declspec(dllexport)
318381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      else
319381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#        define ZEXTERN extern __declspec(dllimport)
320381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      endif
321381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
322381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif  /* ZLIB_DLL */
323381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
324381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * define ZLIB_WINAPI.
325381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
326381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes    */
327381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_WINAPI
328381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef FAR
329381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      undef FAR
330381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
331381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    include <windows.h>
332381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* No need for _export, use ZLIB.DEF instead. */
333381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
334381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    define ZEXPORT WINAPI
335381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef WIN32
336381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA WINAPIV
337381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
338381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA FAR CDECL
339381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
340381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
341381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
342381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
343381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined (__BEOS__)
344381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  ifdef ZLIB_DLL
345381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    ifdef ZLIB_INTERNAL
346381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORT   __declspec(dllexport)
347381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA __declspec(dllexport)
348381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    else
349381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORT   __declspec(dllimport)
350381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#      define ZEXPORTVA __declspec(dllimport)
351381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#    endif
352381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
353381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
354381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
355381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXTERN
356381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXTERN extern
357381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
358381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXPORT
359381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXPORT
360381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
361381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef ZEXPORTVA
362381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define ZEXPORTVA
363381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
364381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
365381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef FAR
366381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define FAR
367381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
368381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
369381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if !defined(__MACTYPES__)
370381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned char  Byte;  /* 8 bits */
371381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
372381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned int   uInt;  /* 16 bits or more */
373381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef unsigned long  uLong; /* 32 bits or more */
374381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
375381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef SMALL_MEDIUM
376381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
377381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Bytef Byte FAR
378381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
379381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte  FAR Bytef;
380381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
381381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef char  FAR charf;
382381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef int   FAR intf;
383381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef uInt  FAR uIntf;
384381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughestypedef uLong FAR uLongf;
385381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
386381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef STDC
387381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void const *voidpc;
388381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void FAR   *voidpf;
389381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef void       *voidp;
390381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
391381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte const *voidpc;
392381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte FAR   *voidpf;
393381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes   typedef Byte       *voidp;
394381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
395381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
39609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
39709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  include <limits.h>
39809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  if (UINT_MAX == 0xffffffffUL)
39909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    define Z_U4 unsigned
40004351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  elif (ULONG_MAX == 0xffffffffUL)
40104351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#    define Z_U4 unsigned long
40204351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  elif (USHRT_MAX == 0xffffffffUL)
40304351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#    define Z_U4 unsigned short
40409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  endif
40509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
40609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
40709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifdef Z_U4
40809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes   typedef Z_U4 z_crc_t;
40909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#else
41009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes   typedef unsigned long z_crc_t;
41109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
41209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
413381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
414381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define Z_HAVE_UNISTD_H
415381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
416381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
417ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
418ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  define Z_HAVE_STDARG_H
419ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
420ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes
421381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifdef STDC
422ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  ifndef Z_SOLO
423ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    include <sys/types.h>      /* for off_t */
424ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  endif
425381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
426381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
42704351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#if defined(STDC) || defined(Z_HAVE_STDARG_H)
42804351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  ifndef Z_SOLO
42904351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#    include <stdarg.h>         /* for va_list */
43004351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  endif
43104351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#endif
43204351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes
43309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifdef _WIN32
43404351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  ifndef Z_SOLO
43504351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#    include <stddef.h>         /* for wchar_t */
43604351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  endif
43709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
43809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
439381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
440381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
441381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * though the former does not conform to the LFS document), but considering
442381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
443381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes * equivalently requesting no 64-bit operations
444381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes */
44504351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
446381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  undef _LARGEFILE64_SOURCE
447381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
448381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
44909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
45009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_HAVE_UNISTD_H
451ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#endif
45209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#ifndef Z_SOLO
45304351a92ecc8429c999acbfc5dfe5aa8bee1d19dElliott Hughes#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
45409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
45509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifdef VMS
45609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      include <unixio.h>       /* for off_t */
45709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
45809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    ifndef z_off_t
45909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#      define z_off_t off_t
46009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    endif
461381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  endif
462381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
463381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
46409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
46509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_LFS64
46609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
46709eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
46809eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
46909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_LARGE64
47009eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
47109eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
47209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
47309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  define Z_WANT64
47409eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#endif
47509eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes
476ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#if !defined(SEEK_SET) && !defined(Z_SOLO)
477381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_SET        0       /* Seek from beginning of file.  */
478381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_CUR        1       /* Seek from current position.  */
479381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
480381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
481381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
482381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#ifndef z_off_t
483381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define z_off_t long
484381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
485381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
48609eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#if !defined(_WIN32) && defined(Z_LARGE64)
487381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#  define z_off64_t off64_t
488381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#else
48909eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
490ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#    define z_off64_t __int64
491ee9e11d0d4e3361533860bf04896abb86a291bfbElliott Hughes#  else
49209eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#    define z_off64_t z_off_t
49309eb358bbbb9aad3fe48dd3368c8a7a481cbda1cElliott Hughes#  endif
494381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
495381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
496381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes/* MVS linker does not support external names larger than 8 bytes */
497381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#if defined(__MVS__)
498381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateInit_,"DEIN")
499381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateInit2_,"DEIN2")
500381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateEnd,"DEEND")
501381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(deflateBound,"DEBND")
502381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateInit_,"ININ")
503381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateInit2_,"ININ2")
504381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateEnd,"INEND")
505381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateSync,"INSY")
506381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflateSetDictionary,"INSEDI")
507381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(compressBound,"CMBND")
508381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_table,"INTABL")
509381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_fast,"INFA")
510381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes  #pragma map(inflate_copyright,"INCOPY")
511381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif
512381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes
513381716e9396b55b1adb8235b020c37344f60ab07Elliott Hughes#endif /* ZCONF_H */
514