xref: /netbsd/external/gpl3/gdb/dist/zlib/zconf.h (revision f72a8c67)
1ed6a76a9Schristos /* zconf.h -- configuration of the zlib compression library
21c468f90Schristos  * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
3ed6a76a9Schristos  * For conditions of distribution and use, see copyright notice in zlib.h
4ed6a76a9Schristos  */
5ed6a76a9Schristos 
6*f72a8c67Schristos /* @(#) $Id: zconf.h,v 1.2 2020/09/15 02:05:31 christos Exp $ */
7ed6a76a9Schristos 
8ed6a76a9Schristos #ifndef ZCONF_H
9ed6a76a9Schristos #define ZCONF_H
10ed6a76a9Schristos 
11ed6a76a9Schristos /*
12ed6a76a9Schristos  * If you *really* need a unique prefix for all types and library functions,
13ed6a76a9Schristos  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14ed6a76a9Schristos  * Even better than compiling with -DZ_PREFIX would be to use configure to set
15ed6a76a9Schristos  * this permanently in zconf.h using "./configure --zprefix".
16ed6a76a9Schristos  */
17ed6a76a9Schristos #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
18ed6a76a9Schristos #  define Z_PREFIX_SET
19ed6a76a9Schristos 
201c468f90Schristos /* all linked symbols and init macros */
21ed6a76a9Schristos #  define _dist_code            z__dist_code
22ed6a76a9Schristos #  define _length_code          z__length_code
23ed6a76a9Schristos #  define _tr_align             z__tr_align
24c03b94e9Schristos #  define _tr_flush_bits        z__tr_flush_bits
25ed6a76a9Schristos #  define _tr_flush_block       z__tr_flush_block
26ed6a76a9Schristos #  define _tr_init              z__tr_init
27ed6a76a9Schristos #  define _tr_stored_block      z__tr_stored_block
28ed6a76a9Schristos #  define _tr_tally             z__tr_tally
29ed6a76a9Schristos #  define adler32               z_adler32
30ed6a76a9Schristos #  define adler32_combine       z_adler32_combine
31ed6a76a9Schristos #  define adler32_combine64     z_adler32_combine64
321c468f90Schristos #  define adler32_z             z_adler32_z
33ed6a76a9Schristos #  ifndef Z_SOLO
34ed6a76a9Schristos #    define compress              z_compress
35ed6a76a9Schristos #    define compress2             z_compress2
36ed6a76a9Schristos #    define compressBound         z_compressBound
37ed6a76a9Schristos #  endif
38ed6a76a9Schristos #  define crc32                 z_crc32
39ed6a76a9Schristos #  define crc32_combine         z_crc32_combine
40ed6a76a9Schristos #  define crc32_combine64       z_crc32_combine64
411c468f90Schristos #  define crc32_z               z_crc32_z
42ed6a76a9Schristos #  define deflate               z_deflate
43ed6a76a9Schristos #  define deflateBound          z_deflateBound
44ed6a76a9Schristos #  define deflateCopy           z_deflateCopy
45ed6a76a9Schristos #  define deflateEnd            z_deflateEnd
461c468f90Schristos #  define deflateGetDictionary  z_deflateGetDictionary
471c468f90Schristos #  define deflateInit           z_deflateInit
481c468f90Schristos #  define deflateInit2          z_deflateInit2
49ed6a76a9Schristos #  define deflateInit2_         z_deflateInit2_
50ed6a76a9Schristos #  define deflateInit_          z_deflateInit_
51ed6a76a9Schristos #  define deflateParams         z_deflateParams
52ed6a76a9Schristos #  define deflatePending        z_deflatePending
53ed6a76a9Schristos #  define deflatePrime          z_deflatePrime
54ed6a76a9Schristos #  define deflateReset          z_deflateReset
55ed6a76a9Schristos #  define deflateResetKeep      z_deflateResetKeep
56ed6a76a9Schristos #  define deflateSetDictionary  z_deflateSetDictionary
57ed6a76a9Schristos #  define deflateSetHeader      z_deflateSetHeader
58ed6a76a9Schristos #  define deflateTune           z_deflateTune
59ed6a76a9Schristos #  define deflate_copyright     z_deflate_copyright
60ed6a76a9Schristos #  define get_crc_table         z_get_crc_table
61ed6a76a9Schristos #  ifndef Z_SOLO
62ed6a76a9Schristos #    define gz_error              z_gz_error
63ed6a76a9Schristos #    define gz_intmax             z_gz_intmax
64ed6a76a9Schristos #    define gz_strwinerror        z_gz_strwinerror
65ed6a76a9Schristos #    define gzbuffer              z_gzbuffer
66ed6a76a9Schristos #    define gzclearerr            z_gzclearerr
67ed6a76a9Schristos #    define gzclose               z_gzclose
68ed6a76a9Schristos #    define gzclose_r             z_gzclose_r
69ed6a76a9Schristos #    define gzclose_w             z_gzclose_w
70ed6a76a9Schristos #    define gzdirect              z_gzdirect
71ed6a76a9Schristos #    define gzdopen               z_gzdopen
72ed6a76a9Schristos #    define gzeof                 z_gzeof
73ed6a76a9Schristos #    define gzerror               z_gzerror
74ed6a76a9Schristos #    define gzflush               z_gzflush
751c468f90Schristos #    define gzfread               z_gzfread
761c468f90Schristos #    define gzfwrite              z_gzfwrite
77ed6a76a9Schristos #    define gzgetc                z_gzgetc
78ed6a76a9Schristos #    define gzgetc_               z_gzgetc_
79ed6a76a9Schristos #    define gzgets                z_gzgets
80ed6a76a9Schristos #    define gzoffset              z_gzoffset
81ed6a76a9Schristos #    define gzoffset64            z_gzoffset64
82ed6a76a9Schristos #    define gzopen                z_gzopen
83ed6a76a9Schristos #    define gzopen64              z_gzopen64
84ed6a76a9Schristos #    ifdef _WIN32
85ed6a76a9Schristos #      define gzopen_w              z_gzopen_w
86ed6a76a9Schristos #    endif
87ed6a76a9Schristos #    define gzprintf              z_gzprintf
88ed6a76a9Schristos #    define gzputc                z_gzputc
89ed6a76a9Schristos #    define gzputs                z_gzputs
90ed6a76a9Schristos #    define gzread                z_gzread
91ed6a76a9Schristos #    define gzrewind              z_gzrewind
92ed6a76a9Schristos #    define gzseek                z_gzseek
93ed6a76a9Schristos #    define gzseek64              z_gzseek64
94ed6a76a9Schristos #    define gzsetparams           z_gzsetparams
95ed6a76a9Schristos #    define gztell                z_gztell
96ed6a76a9Schristos #    define gztell64              z_gztell64
97ed6a76a9Schristos #    define gzungetc              z_gzungetc
981c468f90Schristos #    define gzvprintf             z_gzvprintf
99ed6a76a9Schristos #    define gzwrite               z_gzwrite
100ed6a76a9Schristos #  endif
101ed6a76a9Schristos #  define inflate               z_inflate
102ed6a76a9Schristos #  define inflateBack           z_inflateBack
103ed6a76a9Schristos #  define inflateBackEnd        z_inflateBackEnd
1041c468f90Schristos #  define inflateBackInit       z_inflateBackInit
105ed6a76a9Schristos #  define inflateBackInit_      z_inflateBackInit_
1061c468f90Schristos #  define inflateCodesUsed      z_inflateCodesUsed
107ed6a76a9Schristos #  define inflateCopy           z_inflateCopy
108ed6a76a9Schristos #  define inflateEnd            z_inflateEnd
1091c468f90Schristos #  define inflateGetDictionary  z_inflateGetDictionary
110ed6a76a9Schristos #  define inflateGetHeader      z_inflateGetHeader
1111c468f90Schristos #  define inflateInit           z_inflateInit
1121c468f90Schristos #  define inflateInit2          z_inflateInit2
113ed6a76a9Schristos #  define inflateInit2_         z_inflateInit2_
114ed6a76a9Schristos #  define inflateInit_          z_inflateInit_
115ed6a76a9Schristos #  define inflateMark           z_inflateMark
116ed6a76a9Schristos #  define inflatePrime          z_inflatePrime
117ed6a76a9Schristos #  define inflateReset          z_inflateReset
118ed6a76a9Schristos #  define inflateReset2         z_inflateReset2
1191c468f90Schristos #  define inflateResetKeep      z_inflateResetKeep
120ed6a76a9Schristos #  define inflateSetDictionary  z_inflateSetDictionary
121ed6a76a9Schristos #  define inflateSync           z_inflateSync
122ed6a76a9Schristos #  define inflateSyncPoint      z_inflateSyncPoint
123ed6a76a9Schristos #  define inflateUndermine      z_inflateUndermine
1241c468f90Schristos #  define inflateValidate       z_inflateValidate
125ed6a76a9Schristos #  define inflate_copyright     z_inflate_copyright
126ed6a76a9Schristos #  define inflate_fast          z_inflate_fast
127ed6a76a9Schristos #  define inflate_table         z_inflate_table
128ed6a76a9Schristos #  ifndef Z_SOLO
129ed6a76a9Schristos #    define uncompress            z_uncompress
1301c468f90Schristos #    define uncompress2           z_uncompress2
131ed6a76a9Schristos #  endif
132ed6a76a9Schristos #  define zError                z_zError
133ed6a76a9Schristos #  ifndef Z_SOLO
134ed6a76a9Schristos #    define zcalloc               z_zcalloc
135ed6a76a9Schristos #    define zcfree                z_zcfree
136ed6a76a9Schristos #  endif
137ed6a76a9Schristos #  define zlibCompileFlags      z_zlibCompileFlags
138ed6a76a9Schristos #  define zlibVersion           z_zlibVersion
139ed6a76a9Schristos 
140ed6a76a9Schristos /* all zlib typedefs in zlib.h and zconf.h */
141ed6a76a9Schristos #  define Byte                  z_Byte
142ed6a76a9Schristos #  define Bytef                 z_Bytef
143ed6a76a9Schristos #  define alloc_func            z_alloc_func
144ed6a76a9Schristos #  define charf                 z_charf
145ed6a76a9Schristos #  define free_func             z_free_func
146ed6a76a9Schristos #  ifndef Z_SOLO
147ed6a76a9Schristos #    define gzFile                z_gzFile
148ed6a76a9Schristos #  endif
149ed6a76a9Schristos #  define gz_header             z_gz_header
150ed6a76a9Schristos #  define gz_headerp            z_gz_headerp
151ed6a76a9Schristos #  define in_func               z_in_func
152ed6a76a9Schristos #  define intf                  z_intf
153ed6a76a9Schristos #  define out_func              z_out_func
154ed6a76a9Schristos #  define uInt                  z_uInt
155ed6a76a9Schristos #  define uIntf                 z_uIntf
156ed6a76a9Schristos #  define uLong                 z_uLong
157ed6a76a9Schristos #  define uLongf                z_uLongf
158ed6a76a9Schristos #  define voidp                 z_voidp
159ed6a76a9Schristos #  define voidpc                z_voidpc
160ed6a76a9Schristos #  define voidpf                z_voidpf
161ed6a76a9Schristos 
162ed6a76a9Schristos /* all zlib structs in zlib.h and zconf.h */
163ed6a76a9Schristos #  define gz_header_s           z_gz_header_s
164ed6a76a9Schristos #  define internal_state        z_internal_state
165ed6a76a9Schristos 
166ed6a76a9Schristos #endif
167ed6a76a9Schristos 
168ed6a76a9Schristos #if defined(__MSDOS__) && !defined(MSDOS)
169ed6a76a9Schristos #  define MSDOS
170ed6a76a9Schristos #endif
171ed6a76a9Schristos #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
172ed6a76a9Schristos #  define OS2
173ed6a76a9Schristos #endif
174ed6a76a9Schristos #if defined(_WINDOWS) && !defined(WINDOWS)
175ed6a76a9Schristos #  define WINDOWS
176ed6a76a9Schristos #endif
177ed6a76a9Schristos #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
178ed6a76a9Schristos #  ifndef WIN32
179ed6a76a9Schristos #    define WIN32
180ed6a76a9Schristos #  endif
181ed6a76a9Schristos #endif
182ed6a76a9Schristos #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
183ed6a76a9Schristos #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
184ed6a76a9Schristos #    ifndef SYS16BIT
185ed6a76a9Schristos #      define SYS16BIT
186ed6a76a9Schristos #    endif
187ed6a76a9Schristos #  endif
188ed6a76a9Schristos #endif
189ed6a76a9Schristos 
190ed6a76a9Schristos /*
191ed6a76a9Schristos  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
192ed6a76a9Schristos  * than 64k bytes at a time (needed on systems with 16-bit int).
193ed6a76a9Schristos  */
194ed6a76a9Schristos #ifdef SYS16BIT
195ed6a76a9Schristos #  define MAXSEG_64K
196ed6a76a9Schristos #endif
197ed6a76a9Schristos #ifdef MSDOS
198ed6a76a9Schristos #  define UNALIGNED_OK
199ed6a76a9Schristos #endif
200ed6a76a9Schristos 
201ed6a76a9Schristos #ifdef __STDC_VERSION__
202ed6a76a9Schristos #  ifndef STDC
203ed6a76a9Schristos #    define STDC
204ed6a76a9Schristos #  endif
205ed6a76a9Schristos #  if __STDC_VERSION__ >= 199901L
206ed6a76a9Schristos #    ifndef STDC99
207ed6a76a9Schristos #      define STDC99
208ed6a76a9Schristos #    endif
209ed6a76a9Schristos #  endif
210ed6a76a9Schristos #endif
211ed6a76a9Schristos #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
212ed6a76a9Schristos #  define STDC
213ed6a76a9Schristos #endif
214ed6a76a9Schristos #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
215ed6a76a9Schristos #  define STDC
216ed6a76a9Schristos #endif
217ed6a76a9Schristos #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
218ed6a76a9Schristos #  define STDC
219ed6a76a9Schristos #endif
220ed6a76a9Schristos #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
221ed6a76a9Schristos #  define STDC
222ed6a76a9Schristos #endif
223ed6a76a9Schristos 
224ed6a76a9Schristos #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
225ed6a76a9Schristos #  define STDC
226ed6a76a9Schristos #endif
227ed6a76a9Schristos 
228ed6a76a9Schristos #ifndef STDC
229ed6a76a9Schristos #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
230ed6a76a9Schristos #    define const       /* note: need a more gentle solution here */
231ed6a76a9Schristos #  endif
232ed6a76a9Schristos #endif
233ed6a76a9Schristos 
234ed6a76a9Schristos #if defined(ZLIB_CONST) && !defined(z_const)
235ed6a76a9Schristos #  define z_const const
236ed6a76a9Schristos #else
237ed6a76a9Schristos #  define z_const
238ed6a76a9Schristos #endif
239ed6a76a9Schristos 
2401c468f90Schristos #ifdef Z_SOLO
2411c468f90Schristos    typedef unsigned long z_size_t;
2421c468f90Schristos #else
2431c468f90Schristos #  define z_longlong long long
2441c468f90Schristos #  if defined(NO_SIZE_T)
2451c468f90Schristos      typedef unsigned NO_SIZE_T z_size_t;
2461c468f90Schristos #  elif defined(STDC)
2471c468f90Schristos #    include <stddef.h>
2481c468f90Schristos      typedef size_t z_size_t;
2491c468f90Schristos #  else
2501c468f90Schristos      typedef unsigned long z_size_t;
2511c468f90Schristos #  endif
2521c468f90Schristos #  undef z_longlong
253ed6a76a9Schristos #endif
254ed6a76a9Schristos 
255ed6a76a9Schristos /* Maximum value for memLevel in deflateInit2 */
256ed6a76a9Schristos #ifndef MAX_MEM_LEVEL
257ed6a76a9Schristos #  ifdef MAXSEG_64K
258ed6a76a9Schristos #    define MAX_MEM_LEVEL 8
259ed6a76a9Schristos #  else
260ed6a76a9Schristos #    define MAX_MEM_LEVEL 9
261ed6a76a9Schristos #  endif
262ed6a76a9Schristos #endif
263ed6a76a9Schristos 
264ed6a76a9Schristos /* Maximum value for windowBits in deflateInit2 and inflateInit2.
265ed6a76a9Schristos  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
266ed6a76a9Schristos  * created by gzip. (Files created by minigzip can still be extracted by
267ed6a76a9Schristos  * gzip.)
268ed6a76a9Schristos  */
269ed6a76a9Schristos #ifndef MAX_WBITS
270ed6a76a9Schristos #  define MAX_WBITS   15 /* 32K LZ77 window */
271ed6a76a9Schristos #endif
272ed6a76a9Schristos 
273ed6a76a9Schristos /* The memory requirements for deflate are (in bytes):
274ed6a76a9Schristos             (1 << (windowBits+2)) +  (1 << (memLevel+9))
275ed6a76a9Schristos  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
276ed6a76a9Schristos  plus a few kilobytes for small objects. For example, if you want to reduce
277ed6a76a9Schristos  the default memory requirements from 256K to 128K, compile with
278ed6a76a9Schristos      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
279ed6a76a9Schristos  Of course this will generally degrade compression (there's no free lunch).
280ed6a76a9Schristos 
281ed6a76a9Schristos    The memory requirements for inflate are (in bytes) 1 << windowBits
2821c468f90Schristos  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
283ed6a76a9Schristos  for small objects.
284ed6a76a9Schristos */
285ed6a76a9Schristos 
286ed6a76a9Schristos                         /* Type declarations */
287ed6a76a9Schristos 
288ed6a76a9Schristos #ifndef OF /* function prototypes */
289ed6a76a9Schristos #  ifdef STDC
290ed6a76a9Schristos #    define OF(args)  args
291ed6a76a9Schristos #  else
292ed6a76a9Schristos #    define OF(args)  ()
293ed6a76a9Schristos #  endif
294ed6a76a9Schristos #endif
295ed6a76a9Schristos 
296ed6a76a9Schristos #ifndef Z_ARG /* function prototypes for stdarg */
297ed6a76a9Schristos #  if defined(STDC) || defined(Z_HAVE_STDARG_H)
298ed6a76a9Schristos #    define Z_ARG(args)  args
299ed6a76a9Schristos #  else
300ed6a76a9Schristos #    define Z_ARG(args)  ()
301ed6a76a9Schristos #  endif
302ed6a76a9Schristos #endif
303ed6a76a9Schristos 
304ed6a76a9Schristos /* The following definitions for FAR are needed only for MSDOS mixed
305ed6a76a9Schristos  * model programming (small or medium model with some far allocations).
306ed6a76a9Schristos  * This was tested only with MSC; for other MSDOS compilers you may have
307ed6a76a9Schristos  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
308ed6a76a9Schristos  * just define FAR to be empty.
309ed6a76a9Schristos  */
310ed6a76a9Schristos #ifdef SYS16BIT
311ed6a76a9Schristos #  if defined(M_I86SM) || defined(M_I86MM)
312ed6a76a9Schristos      /* MSC small or medium model */
313ed6a76a9Schristos #    define SMALL_MEDIUM
314ed6a76a9Schristos #    ifdef _MSC_VER
315ed6a76a9Schristos #      define FAR _far
316ed6a76a9Schristos #    else
317ed6a76a9Schristos #      define FAR far
318ed6a76a9Schristos #    endif
319ed6a76a9Schristos #  endif
320ed6a76a9Schristos #  if (defined(__SMALL__) || defined(__MEDIUM__))
321ed6a76a9Schristos      /* Turbo C small or medium model */
322ed6a76a9Schristos #    define SMALL_MEDIUM
323ed6a76a9Schristos #    ifdef __BORLANDC__
324ed6a76a9Schristos #      define FAR _far
325ed6a76a9Schristos #    else
326ed6a76a9Schristos #      define FAR far
327ed6a76a9Schristos #    endif
328ed6a76a9Schristos #  endif
329ed6a76a9Schristos #endif
330ed6a76a9Schristos 
331ed6a76a9Schristos #if defined(WINDOWS) || defined(WIN32)
332ed6a76a9Schristos    /* If building or using zlib as a DLL, define ZLIB_DLL.
333ed6a76a9Schristos     * This is not mandatory, but it offers a little performance increase.
334ed6a76a9Schristos     */
335ed6a76a9Schristos #  ifdef ZLIB_DLL
336ed6a76a9Schristos #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
337ed6a76a9Schristos #      ifdef ZLIB_INTERNAL
338ed6a76a9Schristos #        define ZEXTERN extern __declspec(dllexport)
339ed6a76a9Schristos #      else
340ed6a76a9Schristos #        define ZEXTERN extern __declspec(dllimport)
341ed6a76a9Schristos #      endif
342ed6a76a9Schristos #    endif
343ed6a76a9Schristos #  endif  /* ZLIB_DLL */
344ed6a76a9Schristos    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
345ed6a76a9Schristos     * define ZLIB_WINAPI.
346ed6a76a9Schristos     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
347ed6a76a9Schristos     */
348ed6a76a9Schristos #  ifdef ZLIB_WINAPI
349ed6a76a9Schristos #    ifdef FAR
350ed6a76a9Schristos #      undef FAR
351ed6a76a9Schristos #    endif
352ed6a76a9Schristos #    include <windows.h>
353ed6a76a9Schristos      /* No need for _export, use ZLIB.DEF instead. */
354ed6a76a9Schristos      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
355ed6a76a9Schristos #    define ZEXPORT WINAPI
356ed6a76a9Schristos #    ifdef WIN32
357ed6a76a9Schristos #      define ZEXPORTVA WINAPIV
358ed6a76a9Schristos #    else
359ed6a76a9Schristos #      define ZEXPORTVA FAR CDECL
360ed6a76a9Schristos #    endif
361ed6a76a9Schristos #  endif
362ed6a76a9Schristos #endif
363ed6a76a9Schristos 
364ed6a76a9Schristos #if defined (__BEOS__)
365ed6a76a9Schristos #  ifdef ZLIB_DLL
366ed6a76a9Schristos #    ifdef ZLIB_INTERNAL
367ed6a76a9Schristos #      define ZEXPORT   __declspec(dllexport)
368ed6a76a9Schristos #      define ZEXPORTVA __declspec(dllexport)
369ed6a76a9Schristos #    else
370ed6a76a9Schristos #      define ZEXPORT   __declspec(dllimport)
371ed6a76a9Schristos #      define ZEXPORTVA __declspec(dllimport)
372ed6a76a9Schristos #    endif
373ed6a76a9Schristos #  endif
374ed6a76a9Schristos #endif
375ed6a76a9Schristos 
376ed6a76a9Schristos #ifndef ZEXTERN
377ed6a76a9Schristos #  define ZEXTERN extern
378ed6a76a9Schristos #endif
379ed6a76a9Schristos #ifndef ZEXPORT
380ed6a76a9Schristos #  define ZEXPORT
381ed6a76a9Schristos #endif
382ed6a76a9Schristos #ifndef ZEXPORTVA
383ed6a76a9Schristos #  define ZEXPORTVA
384ed6a76a9Schristos #endif
385ed6a76a9Schristos 
386ed6a76a9Schristos #ifndef FAR
387ed6a76a9Schristos #  define FAR
388ed6a76a9Schristos #endif
389ed6a76a9Schristos 
390ed6a76a9Schristos #if !defined(__MACTYPES__)
391ed6a76a9Schristos typedef unsigned char  Byte;  /* 8 bits */
392ed6a76a9Schristos #endif
393ed6a76a9Schristos typedef unsigned int   uInt;  /* 16 bits or more */
394ed6a76a9Schristos typedef unsigned long  uLong; /* 32 bits or more */
395ed6a76a9Schristos 
396ed6a76a9Schristos #ifdef SMALL_MEDIUM
397ed6a76a9Schristos    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
398ed6a76a9Schristos #  define Bytef Byte FAR
399ed6a76a9Schristos #else
400ed6a76a9Schristos    typedef Byte  FAR Bytef;
401ed6a76a9Schristos #endif
402ed6a76a9Schristos typedef char  FAR charf;
403ed6a76a9Schristos typedef int   FAR intf;
404ed6a76a9Schristos typedef uInt  FAR uIntf;
405ed6a76a9Schristos typedef uLong FAR uLongf;
406ed6a76a9Schristos 
407ed6a76a9Schristos #ifdef STDC
408ed6a76a9Schristos    typedef void const *voidpc;
409ed6a76a9Schristos    typedef void FAR   *voidpf;
410ed6a76a9Schristos    typedef void       *voidp;
411ed6a76a9Schristos #else
412ed6a76a9Schristos    typedef Byte const *voidpc;
413ed6a76a9Schristos    typedef Byte FAR   *voidpf;
414ed6a76a9Schristos    typedef Byte       *voidp;
415ed6a76a9Schristos #endif
416ed6a76a9Schristos 
417ed6a76a9Schristos #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
418ed6a76a9Schristos #  include <limits.h>
419ed6a76a9Schristos #  if (UINT_MAX == 0xffffffffUL)
420ed6a76a9Schristos #    define Z_U4 unsigned
421c03b94e9Schristos #  elif (ULONG_MAX == 0xffffffffUL)
422ed6a76a9Schristos #    define Z_U4 unsigned long
423c03b94e9Schristos #  elif (USHRT_MAX == 0xffffffffUL)
424ed6a76a9Schristos #    define Z_U4 unsigned short
425ed6a76a9Schristos #  endif
426ed6a76a9Schristos #endif
427ed6a76a9Schristos 
428ed6a76a9Schristos #ifdef Z_U4
429ed6a76a9Schristos    typedef Z_U4 z_crc_t;
430ed6a76a9Schristos #else
431ed6a76a9Schristos    typedef unsigned long z_crc_t;
432ed6a76a9Schristos #endif
433ed6a76a9Schristos 
434ed6a76a9Schristos #ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
435ed6a76a9Schristos #  define Z_HAVE_UNISTD_H
436ed6a76a9Schristos #endif
437ed6a76a9Schristos 
438ed6a76a9Schristos #ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
439ed6a76a9Schristos #  define Z_HAVE_STDARG_H
440ed6a76a9Schristos #endif
441ed6a76a9Schristos 
442ed6a76a9Schristos #ifdef STDC
443ed6a76a9Schristos #  ifndef Z_SOLO
444ed6a76a9Schristos #    include <sys/types.h>      /* for off_t */
445ed6a76a9Schristos #  endif
446ed6a76a9Schristos #endif
447ed6a76a9Schristos 
448c03b94e9Schristos #if defined(STDC) || defined(Z_HAVE_STDARG_H)
449c03b94e9Schristos #  ifndef Z_SOLO
450c03b94e9Schristos #    include <stdarg.h>         /* for va_list */
451c03b94e9Schristos #  endif
452c03b94e9Schristos #endif
453c03b94e9Schristos 
454ed6a76a9Schristos #ifdef _WIN32
455c03b94e9Schristos #  ifndef Z_SOLO
456ed6a76a9Schristos #    include <stddef.h>         /* for wchar_t */
457ed6a76a9Schristos #  endif
458c03b94e9Schristos #endif
459ed6a76a9Schristos 
460ed6a76a9Schristos /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
461ed6a76a9Schristos  * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
462ed6a76a9Schristos  * though the former does not conform to the LFS document), but considering
463ed6a76a9Schristos  * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
464ed6a76a9Schristos  * equivalently requesting no 64-bit operations
465ed6a76a9Schristos  */
466c03b94e9Schristos #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
467ed6a76a9Schristos #  undef _LARGEFILE64_SOURCE
468ed6a76a9Schristos #endif
469ed6a76a9Schristos 
470ed6a76a9Schristos #if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
471ed6a76a9Schristos #  define Z_HAVE_UNISTD_H
472ed6a76a9Schristos #endif
473ed6a76a9Schristos #ifndef Z_SOLO
474c03b94e9Schristos #  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
475ed6a76a9Schristos #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
476ed6a76a9Schristos #    ifdef VMS
477ed6a76a9Schristos #      include <unixio.h>       /* for off_t */
478ed6a76a9Schristos #    endif
479ed6a76a9Schristos #    ifndef z_off_t
480ed6a76a9Schristos #      define z_off_t off_t
481ed6a76a9Schristos #    endif
482ed6a76a9Schristos #  endif
483ed6a76a9Schristos #endif
484ed6a76a9Schristos 
485ed6a76a9Schristos #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
486ed6a76a9Schristos #  define Z_LFS64
487ed6a76a9Schristos #endif
488ed6a76a9Schristos 
489ed6a76a9Schristos #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
490ed6a76a9Schristos #  define Z_LARGE64
491ed6a76a9Schristos #endif
492ed6a76a9Schristos 
493ed6a76a9Schristos #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
494ed6a76a9Schristos #  define Z_WANT64
495ed6a76a9Schristos #endif
496ed6a76a9Schristos 
497ed6a76a9Schristos #if !defined(SEEK_SET) && !defined(Z_SOLO)
498ed6a76a9Schristos #  define SEEK_SET        0       /* Seek from beginning of file.  */
499ed6a76a9Schristos #  define SEEK_CUR        1       /* Seek from current position.  */
500ed6a76a9Schristos #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
501ed6a76a9Schristos #endif
502ed6a76a9Schristos 
503ed6a76a9Schristos #ifndef z_off_t
504ed6a76a9Schristos #  define z_off_t long
505ed6a76a9Schristos #endif
506ed6a76a9Schristos 
507ed6a76a9Schristos #if !defined(_WIN32) && defined(Z_LARGE64)
508ed6a76a9Schristos #  define z_off64_t off64_t
509ed6a76a9Schristos #else
510ed6a76a9Schristos #  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
511ed6a76a9Schristos #    define z_off64_t __int64
512ed6a76a9Schristos #  else
513ed6a76a9Schristos #    define z_off64_t z_off_t
514ed6a76a9Schristos #  endif
515ed6a76a9Schristos #endif
516ed6a76a9Schristos 
517ed6a76a9Schristos /* MVS linker does not support external names larger than 8 bytes */
518ed6a76a9Schristos #if defined(__MVS__)
519ed6a76a9Schristos   #pragma map(deflateInit_,"DEIN")
520ed6a76a9Schristos   #pragma map(deflateInit2_,"DEIN2")
521ed6a76a9Schristos   #pragma map(deflateEnd,"DEEND")
522ed6a76a9Schristos   #pragma map(deflateBound,"DEBND")
523ed6a76a9Schristos   #pragma map(inflateInit_,"ININ")
524ed6a76a9Schristos   #pragma map(inflateInit2_,"ININ2")
525ed6a76a9Schristos   #pragma map(inflateEnd,"INEND")
526ed6a76a9Schristos   #pragma map(inflateSync,"INSY")
527ed6a76a9Schristos   #pragma map(inflateSetDictionary,"INSEDI")
528ed6a76a9Schristos   #pragma map(compressBound,"CMBND")
529ed6a76a9Schristos   #pragma map(inflate_table,"INTABL")
530ed6a76a9Schristos   #pragma map(inflate_fast,"INFA")
531ed6a76a9Schristos   #pragma map(inflate_copyright,"INCOPY")
532ed6a76a9Schristos #endif
533ed6a76a9Schristos 
534ed6a76a9Schristos /* Solaris 2.5.1 doesn't have vsnprintf */
535ed6a76a9Schristos #if defined(__sun) && defined(__svr4__)
536ed6a76a9Schristos #include <sys/feature_tests.h>
537ed6a76a9Schristos #if _XOPEN_VERSION < 3
538ed6a76a9Schristos #define NO_vsnprintf
539ed6a76a9Schristos #endif
540ed6a76a9Schristos #endif
541ed6a76a9Schristos 
542ed6a76a9Schristos /* Tru64 UNIX V4.0 neither */
543ed6a76a9Schristos #if defined(__alpha) && defined(__osf__)
544ed6a76a9Schristos #include <unistd.h>
545ed6a76a9Schristos #if _XOPEN_VERSION < 500
546ed6a76a9Schristos #define NO_vsnprintf
547ed6a76a9Schristos #endif
548ed6a76a9Schristos #endif
549ed6a76a9Schristos 
550ed6a76a9Schristos #endif /* ZCONF_H */
551