1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2005 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
11 #if defined(__MSDOS__) && !defined(MSDOS)
14 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
17 #if defined(_WINDOWS) && !defined(WINDOWS)
20 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
25 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
26 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
34 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
35 * than 64k bytes at a time (needed on systems with 16-bit int).
44 #ifdef __STDC_VERSION__
48 # if __STDC_VERSION__ >= 199901L
54 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
57 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
60 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
63 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
67 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
72 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
73 # define const /* note: need a more gentle solution here */
77 /* Some Mac compilers merge all .h files incorrectly: */
78 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
79 # define NO_DUMMY_DECL
82 /* Maximum value for memLevel in deflateInit2 */
85 # define MAX_MEM_LEVEL 8
87 # define MAX_MEM_LEVEL 9
91 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
92 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
93 * created by gzip. (Files created by minigzip can still be extracted by
97 # define MAX_WBITS 15 /* 32K LZ77 window */
100 /* The memory requirements for deflate are (in bytes):
101 (1 << (windowBits+2)) + (1 << (memLevel+9))
102 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
103 plus a few kilobytes for small objects. For example, if you want to reduce
104 the default memory requirements from 256K to 128K, compile with
105 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
106 Of course this will generally degrade compression (there's no free lunch).
108 The memory requirements for inflate are (in bytes) 1 << windowBits
109 that is, 32K for windowBits=15 (default value) plus a few kilobytes
113 /* Type declarations */
115 #ifndef OF /* function prototypes */
117 # define OF(args) args
123 /* The following definitions for FAR are needed only for MSDOS mixed
124 * model programming (small or medium model with some far allocations).
125 * This was tested only with MSC; for other MSDOS compilers you may have
126 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
127 * just define FAR to be empty.
130 # if defined(M_I86SM) || defined(M_I86MM)
131 /* MSC small or medium model */
132 # define SMALL_MEDIUM
139 # if (defined(__SMALL__) || defined(__MEDIUM__))
140 /* Turbo C small or medium model */
141 # define SMALL_MEDIUM
150 #if defined(WINDOWS) || defined(WIN32)
151 /* If building or using zlib as a DLL, define ZLIB_DLL.
152 * This is not mandatory, but it offers a little performance increase.
155 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
156 # ifdef ZLIB_INTERNAL
157 # define ZEXTERN extern __declspec(dllexport)
159 # define ZEXTERN extern __declspec(dllimport)
162 # endif /* ZLIB_DLL */
163 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
164 * define ZLIB_WINAPI.
165 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
171 # include <windows.h>
172 /* No need for _export, use ZLIB.DEF instead. */
173 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
174 # define ZEXPORT WINAPI
176 # define ZEXPORTVA WINAPIV
178 # define ZEXPORTVA FAR CDECL
183 #if defined (__BEOS__)
185 # ifdef ZLIB_INTERNAL
186 # define ZEXPORT __declspec(dllexport)
187 # define ZEXPORTVA __declspec(dllexport)
189 # define ZEXPORT __declspec(dllimport)
190 # define ZEXPORTVA __declspec(dllimport)
196 # define ZEXTERN extern
209 #if !defined(__MACTYPES__)
210 typedef unsigned char Byte; /* 8 bits */
212 typedef unsigned int uInt; /* 16 bits or more */
213 typedef unsigned long uLong; /* 32 bits or more */
216 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
217 # define Bytef Byte FAR
219 typedef Byte FAR Bytef;
221 typedef char FAR charf;
222 typedef int FAR intf;
223 typedef uInt FAR uIntf;
224 typedef uLong FAR uLongf;
227 typedef void const *voidpc;
228 typedef void FAR *voidpf;
231 typedef Byte const *voidpc;
232 typedef Byte FAR *voidpf;
236 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
237 # include <sys/types.h> /* for off_t */
238 # include <unistd.h> /* for SEEK_* and off_t */
240 # include <unixio.h> /* for off_t */
242 # define z_off_t off_t
245 # define SEEK_SET 0 /* Seek from beginning of file. */
246 # define SEEK_CUR 1 /* Seek from current position. */
247 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
250 # define z_off_t long
253 #if defined(__OS400__)
254 # define NO_vsnprintf
258 # define NO_vsnprintf
264 /* MVS linker does not support external names larger than 8 bytes */
266 # pragma map(deflateInit_,"DEIN")
267 # pragma map(deflateInit2_,"DEIN2")
268 # pragma map(deflateEnd,"DEEND")
269 # pragma map(deflateBound,"DEBND")
270 # pragma map(inflateInit_,"ININ")
271 # pragma map(inflateInit2_,"ININ2")
272 # pragma map(inflateEnd,"INEND")
273 # pragma map(inflateSync,"INSY")
274 # pragma map(inflateSetDictionary,"INSEDI")
275 # pragma map(compressBound,"CMBND")
276 # pragma map(inflate_table,"INTABL")
277 # pragma map(inflate_fast,"INFA")
278 # pragma map(inflate_copyright,"INCOPY")