Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmzlib / zconf.h
blob985b1256a178ab93dfe455e5cab99b8210201a03
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 */
6 <<<<<<< zconf.h
7 /* @(#) $Id: zconf.h,v 1.3 2007/09/11 15:22:29 david.cole Exp $ */
8 =======
9 /* @(#) $Id: zconf.h,v 1.4 2008-09-15 21:53:28 hoffman Exp $ */
10 >>>>>>> 1.4
12 #ifndef ZCONF_H
13 #define ZCONF_H
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.
25 #ifdef Z_PREFIX
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
60 # define Byte z_Byte
61 # define uInt z_uInt
62 # define uLong z_uLong
63 # define Bytef z_Bytef
64 # define charf z_charf
65 # define intf z_intf
66 # define uIntf z_uIntf
67 # define uLongf z_uLongf
68 # define voidpf z_voidpf
69 # define voidp z_voidp
70 #endif
72 #if defined(__MSDOS__) && !defined(MSDOS)
73 # define MSDOS
74 #endif
75 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
76 # define OS2
77 #endif
78 #if defined(_WINDOWS) && !defined(WINDOWS)
79 # define WINDOWS
80 #endif
81 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
82 # ifndef WIN32
83 # define WIN32
84 # endif
85 #endif
86 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
87 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
88 # ifndef SYS16BIT
89 # define SYS16BIT
90 # endif
91 # endif
92 #endif
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).
98 #ifdef SYS16BIT
99 # define MAXSEG_64K
100 #endif
101 #ifdef MSDOS
102 # define UNALIGNED_OK
103 #endif
105 #ifdef __STDC_VERSION__
106 # ifndef STDC
107 # define STDC
108 # endif
109 # if __STDC_VERSION__ >= 199901L
110 # ifndef STDC99
111 # define STDC99
112 # endif
113 # endif
114 #endif
115 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
116 # define STDC
117 #endif
118 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
119 # define STDC
120 #endif
121 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
122 # define STDC
123 #endif
124 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
125 # define STDC
126 #endif
128 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
129 # define STDC
130 #endif
132 #ifndef STDC
133 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
134 # define const /* note: need a more gentle solution here */
135 # endif
136 #endif
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
141 #endif
143 /* Maximum value for memLevel in deflateInit2 */
144 #ifndef MAX_MEM_LEVEL
145 # ifdef MAXSEG_64K
146 # define MAX_MEM_LEVEL 8
147 # else
148 # define MAX_MEM_LEVEL 9
149 # endif
150 #endif
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
155 * gzip.)
157 #ifndef MAX_WBITS
158 # define MAX_WBITS 15 /* 32K LZ77 window */
159 #endif
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
171 for small objects.
174 /* Type declarations */
176 #ifndef OF /* function prototypes */
177 # ifdef STDC
178 # define OF(args) args
179 # else
180 # define OF(args) ()
181 # endif
182 #endif
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.
190 #ifdef SYS16BIT
191 # if defined(M_I86SM) || defined(M_I86MM)
192 /* MSC small or medium model */
193 # define SMALL_MEDIUM
194 # ifdef _MSC_VER
195 # define FAR _far
196 # else
197 # define FAR far
198 # endif
199 # endif
200 # if (defined(__SMALL__) || defined(__MEDIUM__))
201 /* Turbo C small or medium model */
202 # define SMALL_MEDIUM
203 # ifdef __BORLANDC__
204 # define FAR _far
205 # else
206 # define FAR far
207 # endif
208 # endif
209 #endif
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.
215 # ifdef ZLIB_DLL
216 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
217 # ifdef ZLIB_INTERNAL
218 # define ZEXTERN extern __declspec(dllexport)
219 # else
220 # define ZEXTERN extern __declspec(dllimport)
221 # endif
222 # endif
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.
228 # ifdef ZLIB_WINAPI
229 # ifdef FAR
230 # undef FAR
231 # endif
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
236 # ifdef WIN32
237 # define ZEXPORTVA WINAPIV
238 # else
239 # define ZEXPORTVA FAR CDECL
240 # endif
241 # endif
242 #endif
244 #if defined (__BEOS__) && !defined (__HAIKU__)
245 # ifdef ZLIB_DLL
246 # ifdef ZLIB_INTERNAL
247 # define ZEXPORT __declspec(dllexport)
248 # define ZEXPORTVA __declspec(dllexport)
249 # else
250 # define ZEXPORT __declspec(dllimport)
251 # define ZEXPORTVA __declspec(dllimport)
252 # endif
253 # endif
254 #endif
256 #ifndef ZEXTERN
257 # define ZEXTERN extern
258 #endif
259 #ifndef ZEXPORT
260 # define ZEXPORT
261 #endif
262 #ifndef ZEXPORTVA
263 # define ZEXPORTVA
264 #endif
266 #ifndef FAR
267 # define FAR
268 #endif
270 #if !defined(__MACTYPES__)
271 typedef unsigned char Byte; /* 8 bits */
272 #endif
273 typedef unsigned int uInt; /* 16 bits or more */
274 typedef unsigned long uLong; /* 32 bits or more */
276 #ifdef SMALL_MEDIUM
277 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
278 # define Bytef Byte FAR
279 #else
280 typedef Byte FAR Bytef;
281 #endif
282 typedef char FAR charf;
283 typedef int FAR intf;
284 typedef uInt FAR uIntf;
285 typedef uLong FAR uLongf;
287 #ifdef STDC
288 typedef void const *voidpc;
289 typedef void FAR *voidpf;
290 typedef void *voidp;
291 #else
292 typedef Byte const *voidpc;
293 typedef Byte FAR *voidpf;
294 typedef Byte *voidp;
295 #endif
297 /* KITWARE_ZLIB_CHANGE - Since VTK/ITK/CMake use CMake, not ./configure, we can go ahead and test HAVE_UNISTD_H */
298 #ifdef HAVE_UNISTD_H
299 # include <sys/types.h> /* for off_t */
300 # include <unistd.h> /* for SEEK_* and off_t */
301 # ifdef VMS
302 # include <unixio.h> /* for off_t */
303 # endif
304 # define z_off_t off_t
305 #endif
306 #ifndef SEEK_SET
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" */
310 #endif
311 #ifndef z_off_t
312 # define z_off_t long
313 #endif
315 #if defined(__OS400__)
316 # define NO_vsnprintf
317 #endif
319 #if defined(__MVS__)
320 # define NO_vsnprintf
321 # ifdef FAR
322 # undef FAR
323 # endif
324 #endif
326 /* MVS linker does not support external names larger than 8 bytes */
327 #if defined(__MVS__)
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")
341 #endif
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 */
348 #endif
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 */
353 #endif
355 #endif /* ZCONF_H */