v0.13.0
zconf.h
Go to the documentation of this file.
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
4  */
5 
6 /* @(#) $Id: zconf.h,v 1.2 2007-08-14 14:02:42 seanmcbride Exp $ */
7 
8 #ifndef ZCONF_H
9 #define ZCONF_H
10 
11 /* KITWARE_ZLIB_CHANGE - Added to mangle function names */
12 #include "itk_zlib_mangle.h"
13 
14 /* KITWARE_ZLIB_CHANGE - Added to get the correct definition of ZLIB_DLL */
15 #include "itkzlib/zlibDllConfig.h"
16 
17 /*
18  * If you *really* need a unique prefix for all types and library functions,
19  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
20  */
21 #ifdef Z_PREFIX
22 # define deflateInit_ z_deflateInit_
23 # define deflate z_deflate
24 # define deflateEnd z_deflateEnd
25 # define inflateInit_ z_inflateInit_
26 # define inflate z_inflate
27 # define inflateEnd z_inflateEnd
28 # define deflateInit2_ z_deflateInit2_
29 # define deflateSetDictionary z_deflateSetDictionary
30 # define deflateCopy z_deflateCopy
31 # define deflateReset z_deflateReset
32 # define deflateParams z_deflateParams
33 # define deflateBound z_deflateBound
34 # define deflatePrime z_deflatePrime
35 # define inflateInit2_ z_inflateInit2_
36 # define inflateSetDictionary z_inflateSetDictionary
37 # define inflateSync z_inflateSync
38 # define inflateSyncPoint z_inflateSyncPoint
39 # define inflateCopy z_inflateCopy
40 # define inflateReset z_inflateReset
41 # define inflateBack z_inflateBack
42 # define inflateBackEnd z_inflateBackEnd
43 # define compress z_compress
44 # define compress2 z_compress2
45 # define compressBound z_compressBound
46 # define uncompress z_uncompress
47 # define adler32 z_adler32
48 # define crc32 z_crc32
49 # define get_crc_table z_get_crc_table
50 # define zError z_zError
51 
52 # define alloc_func z_alloc_func
53 # define free_func z_free_func
54 # define in_func z_in_func
55 # define out_func z_out_func
56 # define Byte z_Byte
57 # define uInt z_uInt
58 # define uLong z_uLong
59 # define Bytef z_Bytef
60 # define charf z_charf
61 # define intf z_intf
62 # define uIntf z_uIntf
63 # define uLongf z_uLongf
64 # define voidpf z_voidpf
65 # define voidp z_voidp
66 #endif
67 
68 #if defined(__MSDOS__) && !defined(MSDOS)
69 # define MSDOS
70 #endif
71 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
72 # define OS2
73 #endif
74 #if defined(_WINDOWS) && !defined(WINDOWS)
75 # define WINDOWS
76 #endif
77 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
78 # ifndef WIN32
79 # define WIN32
80 # endif
81 #endif
82 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
83 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
84 # ifndef SYS16BIT
85 # define SYS16BIT
86 # endif
87 # endif
88 #endif
89 
90 /*
91  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
92  * than 64k bytes at a time (needed on systems with 16-bit int).
93  */
94 #ifdef SYS16BIT
95 # define MAXSEG_64K
96 #endif
97 #ifdef MSDOS
98 # define UNALIGNED_OK
99 #endif
100 
101 #ifdef __STDC_VERSION__
102 # ifndef STDC
103 # define STDC
104 # endif
105 # if __STDC_VERSION__ >= 199901L
106 # ifndef STDC99
107 # define STDC99
108 # endif
109 # endif
110 #endif
111 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
112 # define STDC
113 #endif
114 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
115 # define STDC
116 #endif
117 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
118 # define STDC
119 #endif
120 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
121 # define STDC
122 #endif
123 
124 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
125 # define STDC
126 #endif
127 
128 #ifndef STDC
129 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
130 # define const /* note: need a more gentle solution here */
131 # endif
132 #endif
133 
134 /* Some Mac compilers merge all .h files incorrectly: */
135 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
136 # define NO_DUMMY_DECL
137 #endif
138 
139 /* Maximum value for memLevel in deflateInit2 */
140 #ifndef MAX_MEM_LEVEL
141 # ifdef MAXSEG_64K
142 # define MAX_MEM_LEVEL 8
143 # else
144 # define MAX_MEM_LEVEL 9
145 # endif
146 #endif
147 
148 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
149  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
150  * created by gzip. (Files created by minigzip can still be extracted by
151  * gzip.)
152  */
153 #ifndef MAX_WBITS
154 # define MAX_WBITS 15 /* 32K LZ77 window */
155 #endif
156 
157 /* The memory requirements for deflate are (in bytes):
158  (1 << (windowBits+2)) + (1 << (memLevel+9))
159  that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
160  plus a few kilobytes for small objects. For example, if you want to reduce
161  the default memory requirements from 256K to 128K, compile with
162  make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
163  Of course this will generally degrade compression (there's no free lunch).
164 
165  The memory requirements for inflate are (in bytes) 1 << windowBits
166  that is, 32K for windowBits=15 (default value) plus a few kilobytes
167  for small objects.
168 */
169 
170  /* Type declarations */
171 
172 #ifndef OF /* function prototypes */
173 # ifdef STDC
174 # define OF(args) args
175 # else
176 # define OF(args) ()
177 # endif
178 #endif
179 
180 /* The following definitions for FAR are needed only for MSDOS mixed
181  * model programming (small or medium model with some far allocations).
182  * This was tested only with MSC; for other MSDOS compilers you may have
183  * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
184  * just define FAR to be empty.
185  */
186 #ifdef SYS16BIT
187 # if defined(M_I86SM) || defined(M_I86MM)
188  /* MSC small or medium model */
189 # define SMALL_MEDIUM
190 # ifdef _MSC_VER
191 # define FAR _far
192 # else
193 # define FAR far
194 # endif
195 # endif
196 # if (defined(__SMALL__) || defined(__MEDIUM__))
197  /* Turbo C small or medium model */
198 # define SMALL_MEDIUM
199 # ifdef __BORLANDC__
200 # define FAR _far
201 # else
202 # define FAR far
203 # endif
204 # endif
205 #endif
206 
207 #if defined(WINDOWS) || defined(WIN32)
208  /* If building or using zlib as a DLL, define ZLIB_DLL.
209  * This is not mandatory, but it offers a little performance increase.
210  */
211 # ifdef ZLIB_DLL
212 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
213 # ifdef ZLIB_INTERNAL
214 # define ZEXTERN extern __declspec(dllexport)
215 # else
216 # define ZEXTERN extern __declspec(dllimport)
217 # endif
218 # endif
219 # endif /* ZLIB_DLL */
220  /* If building or using zlib with the WINAPI/WINAPIV calling convention,
221  * define ZLIB_WINAPI.
222  * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
223  */
224 # ifdef ZLIB_WINAPI
225 # ifdef FAR
226 # undef FAR
227 # endif
228 # include <windows.h>
229  /* No need for _export, use ZLIB.DEF instead. */
230  /* For complete Windows compatibility, use WINAPI, not __stdcall. */
231 # define ZEXPORT WINAPI
232 # ifdef WIN32
233 # define ZEXPORTVA WINAPIV
234 # else
235 # define ZEXPORTVA FAR CDECL
236 # endif
237 # endif
238 #endif
239 
240 #if defined (__BEOS__)
241 # ifdef ZLIB_DLL
242 # ifdef ZLIB_INTERNAL
243 # define ZEXPORT __declspec(dllexport)
244 # define ZEXPORTVA __declspec(dllexport)
245 # else
246 # define ZEXPORT __declspec(dllimport)
247 # define ZEXPORTVA __declspec(dllimport)
248 # endif
249 # endif
250 #endif
251 
252 #ifndef ZEXTERN
253 # define ZEXTERN extern
254 #endif
255 #ifndef ZEXPORT
256 # define ZEXPORT
257 #endif
258 #ifndef ZEXPORTVA
259 # define ZEXPORTVA
260 #endif
261 
262 #ifndef FAR
263 # define FAR
264 #endif
265 
266 #if !defined(__MACTYPES__)
267 typedef unsigned char Byte; /* 8 bits */
268 #endif
269 typedef unsigned int uInt; /* 16 bits or more */
270 typedef unsigned long uLong; /* 32 bits or more */
271 
272 #ifdef SMALL_MEDIUM
273  /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
274 # define Bytef Byte FAR
275 #else
276  typedef Byte FAR Bytef;
277 #endif
278 typedef char FAR charf;
279 typedef int FAR intf;
280 typedef uInt FAR uIntf;
281 typedef uLong FAR uLongf;
282 
283 #ifdef STDC
284  typedef void const *voidpc;
285  typedef void FAR *voidpf;
286  typedef void *voidp;
287 #else
288  typedef Byte const *voidpc;
289  typedef Byte FAR *voidpf;
290  typedef Byte *voidp;
291 #endif
292 
293 /* KITWARE_ZLIB_CHANGE - Since VTK/ITK use CMake, not ./configure, we can go ahead and test HAVE_UNISTD_H */
294 #ifdef HAVE_UNISTD_H
295 # include <sys/types.h> /* for off_t */
296 # include <unistd.h> /* for SEEK_* and off_t */
297 # ifdef VMS
298 # include <unixio.h> /* for off_t */
299 # endif
300 # define z_off_t off_t
301 #endif
302 #ifndef SEEK_SET
303 # define SEEK_SET 0 /* Seek from beginning of file. */
304 # define SEEK_CUR 1 /* Seek from current position. */
305 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
306 #endif
307 #ifndef z_off_t
308 # define z_off_t long
309 #endif
310 
311 #if defined(__OS400__)
312 # define NO_vsnprintf
313 #endif
314 
315 #if defined(__MVS__)
316 # define NO_vsnprintf
317 # ifdef FAR
318 # undef FAR
319 # endif
320 #endif
321 
322 /* MVS linker does not support external names larger than 8 bytes */
323 #if defined(__MVS__)
324 # pragma map(deflateInit_,"DEIN")
325 # pragma map(deflateInit2_,"DEIN2")
326 # pragma map(deflateEnd,"DEEND")
327 # pragma map(deflateBound,"DEBND")
328 # pragma map(inflateInit_,"ININ")
329 # pragma map(inflateInit2_,"ININ2")
330 # pragma map(inflateEnd,"INEND")
331 # pragma map(inflateSync,"INSY")
332 # pragma map(inflateSetDictionary,"INSEDI")
333 # pragma map(compressBound,"CMBND")
334 # pragma map(inflate_table,"INTABL")
335 # pragma map(inflate_fast,"INFA")
336 # pragma map(inflate_copyright,"INCOPY")
337 #endif
338 
339 /* KITWARE_ZLIB_CHANGE - Added to suppress complier warnings */
340 #if defined(_MSC_VER)
341 #pragma warning ( disable : 4127 ) /* cond expr is constant */
342 #pragma warning ( disable : 4131 ) /* old style declaration */
343 #pragma warning ( disable : 4244 ) /* conversion loss of data */
344 #endif
345 #if defined(__BORLANDC__)
346 #pragma warn -8004 /* assigned a value that is never used */
347 #pragma warn -8008 /* condition is always true */
348 #pragma warn -8066 /* unreachable code */
349 #endif
350 
351 #endif /* ZCONF_H */
uLong FAR uLongf
Definition: zconf.h:281
Byte FAR * voidpf
Definition: zconf.h:289
char FAR charf
Definition: zconf.h:278
Byte const * voidpc
Definition: zconf.h:288
unsigned int uInt
Definition: zconf.h:269
Byte * voidp
Definition: zconf.h:290
int FAR intf
Definition: zconf.h:279
unsigned long uLong
Definition: zconf.h:270
uInt FAR uIntf
Definition: zconf.h:280
unsigned char Byte
Definition: zconf.h:267
Byte FAR Bytef
Definition: zconf.h:276
#define FAR
Definition: zconf.h:263