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
7 /* @(#) $Id: zconf.h,v 1.3 2007/09/11 15:22:29 david.cole Exp $ */
9 /* @(#) $Id: zconf.h,v 1.4 2008-09-15 21:53:28 hoffman Exp $ */
15 /* KITWARE_ZLIB_CHANGE - Added to mangle function names */
16 #include "cm_zlib_mangle.h"
18 /* KITWARE_ZLIB_CHANGE - Added to get the correct definition of ZLIB_DLL */
19 #include "cmzlib/zlibDllConfig.h"
22 * If you *really* need a unique prefix for all types and library functions,
23 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
26 # define deflateInit_ z_deflateInit_
27 # define deflate z_deflate
28 # define deflateEnd z_deflateEnd
29 # define inflateInit_ z_inflateInit_
30 # define inflate z_inflate
31 # define inflateEnd z_inflateEnd
32 # define deflateInit2_ z_deflateInit2_
33 # define deflateSetDictionary z_deflateSetDictionary
34 # define deflateCopy z_deflateCopy
35 # define deflateReset z_deflateReset
36 # define deflateParams z_deflateParams
37 # define deflateBound z_deflateBound
38 # define deflatePrime z_deflatePrime
39 # define inflateInit2_ z_inflateInit2_
40 # define inflateSetDictionary z_inflateSetDictionary
41 # define inflateSync z_inflateSync
42 # define inflateSyncPoint z_inflateSyncPoint
43 # define inflateCopy z_inflateCopy
44 # define inflateReset z_inflateReset
45 # define inflateBack z_inflateBack
46 # define inflateBackEnd z_inflateBackEnd
47 # define compress z_compress
48 # define compress2 z_compress2
49 # define compressBound z_compressBound
50 # define uncompress z_uncompress
51 # define adler32 z_adler32
52 # define crc32 z_crc32
53 # define get_crc_table z_get_crc_table
54 # define zError z_zError
56 # define alloc_func z_alloc_func
57 # define free_func z_free_func
58 # define in_func z_in_func
59 # define out_func z_out_func
62 # define uLong z_uLong
63 # define Bytef z_Bytef
64 # define charf z_charf
66 # define uIntf z_uIntf
67 # define uLongf z_uLongf
68 # define voidpf z_voidpf
69 # define voidp z_voidp
72 #if defined(__MSDOS__) && !defined(MSDOS)
75 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
78 #if defined(_WINDOWS) && !defined(WINDOWS)
81 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
86 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
87 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
95 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
96 * than 64k bytes at a time (needed on systems with 16-bit int).
102 # define UNALIGNED_OK
105 #ifdef __STDC_VERSION__
109 # if __STDC_VERSION__ >= 199901L
115 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
118 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
121 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
124 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
128 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
133 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
134 # define const /* note: need a more gentle solution here */
138 /* Some Mac compilers merge all .h files incorrectly: */
139 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
140 # define NO_DUMMY_DECL
143 /* Maximum value for memLevel in deflateInit2 */
144 #ifndef MAX_MEM_LEVEL
146 # define MAX_MEM_LEVEL 8
148 # define MAX_MEM_LEVEL 9
152 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
153 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
154 * created by gzip. (Files created by minigzip can still be extracted by
158 # define MAX_WBITS 15 /* 32K LZ77 window */
161 /* The memory requirements for deflate are (in bytes):
162 (1 << (windowBits+2)) + (1 << (memLevel+9))
163 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
164 plus a few kilobytes for small objects. For example, if you want to reduce
165 the default memory requirements from 256K to 128K, compile with
166 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
167 Of course this will generally degrade compression (there's no free lunch).
169 The memory requirements for inflate are (in bytes) 1 << windowBits
170 that is, 32K for windowBits=15 (default value) plus a few kilobytes
174 /* Type declarations */
176 #ifndef OF /* function prototypes */
178 # define OF(args) args
184 /* The following definitions for FAR are needed only for MSDOS mixed
185 * model programming (small or medium model with some far allocations).
186 * This was tested only with MSC; for other MSDOS compilers you may have
187 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
188 * just define FAR to be empty.
191 # if defined(M_I86SM) || defined(M_I86MM)
192 /* MSC small or medium model */
193 # define SMALL_MEDIUM
200 # if (defined(__SMALL__) || defined(__MEDIUM__))
201 /* Turbo C small or medium model */
202 # define SMALL_MEDIUM
211 #if defined(WINDOWS) || defined(WIN32)
212 /* If building or using zlib as a DLL, define ZLIB_DLL.
213 * This is not mandatory, but it offers a little performance increase.
216 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
217 # ifdef ZLIB_INTERNAL
218 # define ZEXTERN extern __declspec(dllexport)
220 # define ZEXTERN extern __declspec(dllimport)
223 # endif /* ZLIB_DLL */
224 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
225 * define ZLIB_WINAPI.
226 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
232 # include <windows.h>
233 /* No need for _export, use ZLIB.DEF instead. */
234 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
235 # define ZEXPORT WINAPI
237 # define ZEXPORTVA WINAPIV
239 # define ZEXPORTVA FAR CDECL
244 #if defined (__BEOS__) && !defined (__HAIKU__)
246 # ifdef ZLIB_INTERNAL
247 # define ZEXPORT __declspec(dllexport)
248 # define ZEXPORTVA __declspec(dllexport)
250 # define ZEXPORT __declspec(dllimport)
251 # define ZEXPORTVA __declspec(dllimport)
257 # define ZEXTERN extern
270 #if !defined(__MACTYPES__)
271 typedef unsigned char Byte
; /* 8 bits */
273 typedef unsigned int uInt
; /* 16 bits or more */
274 typedef unsigned long uLong
; /* 32 bits or more */
277 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
278 # define Bytef Byte FAR
280 typedef Byte FAR Bytef
;
282 typedef char FAR charf
;
283 typedef int FAR intf
;
284 typedef uInt FAR uIntf
;
285 typedef uLong FAR uLongf
;
288 typedef void const *voidpc
;
289 typedef void FAR
*voidpf
;
292 typedef Byte
const *voidpc
;
293 typedef Byte FAR
*voidpf
;
297 /* KITWARE_ZLIB_CHANGE - Since VTK/ITK/CMake use CMake, not ./configure, we can go ahead and test HAVE_UNISTD_H */
299 # include <sys/types.h> /* for off_t */
300 # include <unistd.h> /* for SEEK_* and off_t */
302 # include <unixio.h> /* for off_t */
304 # define z_off_t off_t
307 # define SEEK_SET 0 /* Seek from beginning of file. */
308 # define SEEK_CUR 1 /* Seek from current position. */
309 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
312 # define z_off_t long
315 #if defined(__OS400__)
316 # define NO_vsnprintf
320 # define NO_vsnprintf
326 /* MVS linker does not support external names larger than 8 bytes */
328 # pragma map(deflateInit_,"DEIN")
329 # pragma map(deflateInit2_,"DEIN2")
330 # pragma map(deflateEnd,"DEEND")
331 # pragma map(deflateBound,"DEBND")
332 # pragma map(inflateInit_,"ININ")
333 # pragma map(inflateInit2_,"ININ2")
334 # pragma map(inflateEnd,"INEND")
335 # pragma map(inflateSync,"INSY")
336 # pragma map(inflateSetDictionary,"INSEDI")
337 # pragma map(compressBound,"CMBND")
338 # pragma map(inflate_table,"INTABL")
339 # pragma map(inflate_fast,"INFA")
340 # pragma map(inflate_copyright,"INCOPY")
343 /* KITWARE_ZLIB_CHANGE - Added to suppress complier warnings */
344 #if defined(_MSC_VER)
345 #pragma warning ( disable : 4127 ) /* cond expr is constant */
346 #pragma warning ( disable : 4131 ) /* old style declaration */
347 #pragma warning ( disable : 4244 ) /* conversion loss of data */
349 #if defined(__BORLANDC__)
350 #pragma warn -8004 /* assigned a value that is never used */
351 #pragma warn -8008 /* condition is always true */
352 #pragma warn -8066 /* unreachable code */