]>
git.saurik.com Git - apple/xnu.git/blob - libkern/libkern/zconf.h
2 * Copyright (c) 2008 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
28 /* zconf.h -- configuration of the zlib compression library
29 * Copyright (C) 1995-2005 Jean-loup Gailly.
30 * For conditions of distribution and use, see copyright notice in zlib.h
39 * If you *really* need a unique prefix for all types and library functions,
40 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
43 # define deflateInit_ z_deflateInit_
44 # define deflate z_deflate
45 # define deflateEnd z_deflateEnd
46 # define inflateInit_ z_inflateInit_
47 # define inflate z_inflate
48 # define inflateEnd z_inflateEnd
49 # define deflateInit2_ z_deflateInit2_
50 # define deflateSetDictionary z_deflateSetDictionary
51 # define deflateCopy z_deflateCopy
52 # define deflateReset z_deflateReset
53 # define deflateParams z_deflateParams
54 # define deflateBound z_deflateBound
55 # define deflatePrime z_deflatePrime
56 # define inflateInit2_ z_inflateInit2_
57 # define inflateSetDictionary z_inflateSetDictionary
58 # define inflateSync z_inflateSync
59 # define inflateSyncPoint z_inflateSyncPoint
60 # define inflateCopy z_inflateCopy
61 # define inflateReset z_inflateReset
62 # define inflateBack z_inflateBack
63 # define inflateBackEnd z_inflateBackEnd
64 # define compress z_compress
65 # define compress2 z_compress2
66 # define compressBound z_compressBound
67 # define uncompress z_uncompress
68 # define adler32 z_adler32
69 # define crc32 z_crc32
70 # define get_crc_table z_get_crc_table
71 # define zError z_zError
73 # define alloc_func z_alloc_func
74 # define free_func z_free_func
75 # define in_func z_in_func
76 # define out_func z_out_func
79 # define uLong z_uLong
80 # define Bytef z_Bytef
81 # define charf z_charf
83 # define uIntf z_uIntf
84 # define uLongf z_uLongf
85 # define voidpf z_voidpf
86 # define voidp z_voidp
89 #if defined(__MSDOS__) && !defined(MSDOS)
92 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
95 #if defined(_WINDOWS) && !defined(WINDOWS)
98 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
103 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
104 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
112 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
113 * than 64k bytes at a time (needed on systems with 16-bit int).
119 # define UNALIGNED_OK
122 #ifdef __STDC_VERSION__
126 # if __STDC_VERSION__ >= 199901L
132 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
135 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
138 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
141 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
145 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
150 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
151 # define const /* note: need a more gentle solution here */
155 /* Some Mac compilers merge all .h files incorrectly: */
156 #if defined(__MWERKS__) || defined(applec) || defined(THINK_C) || defined(__SC__)
157 # define NO_DUMMY_DECL
160 /* Maximum value for memLevel in deflateInit2 */
161 #ifndef MAX_MEM_LEVEL
163 # define MAX_MEM_LEVEL 8
165 # define MAX_MEM_LEVEL 9
169 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
170 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
171 * created by gzip. (Files created by minigzip can still be extracted by
175 # define MAX_WBITS 15 /* 32K LZ77 window */
178 /* The memory requirements for deflate are (in bytes):
179 * (1 << (windowBits+2)) + (1 << (memLevel+9))
180 * that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
181 * plus a few kilobytes for small objects. For example, if you want to reduce
182 * the default memory requirements from 256K to 128K, compile with
183 * make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
184 * Of course this will generally degrade compression (there's no free lunch).
186 * The memory requirements for inflate are (in bytes) 1 << windowBits
187 * that is, 32K for windowBits=15 (default value) plus a few kilobytes
191 /* Type declarations */
193 #ifndef OF /* function prototypes */
195 # define OF(args) args
201 /* The following definitions for FAR are needed only for MSDOS mixed
202 * model programming (small or medium model with some far allocations).
203 * This was tested only with MSC; for other MSDOS compilers you may have
204 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
205 * just define FAR to be empty.
208 # if defined(M_I86SM) || defined(M_I86MM)
209 /* MSC small or medium model */
210 # define SMALL_MEDIUM
217 # if (defined(__SMALL__) || defined(__MEDIUM__))
218 /* Turbo C small or medium model */
219 # define SMALL_MEDIUM
228 #if defined(WINDOWS) || defined(WIN32)
229 /* If building or using zlib as a DLL, define ZLIB_DLL.
230 * This is not mandatory, but it offers a little performance increase.
233 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
234 # ifdef ZLIB_INTERNAL
235 # define ZEXTERN extern __declspec(dllexport)
237 # define ZEXTERN extern __declspec(dllimport)
240 # endif /* ZLIB_DLL */
241 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
242 * define ZLIB_WINAPI.
243 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
249 # include <windows.h>
250 /* No need for _export, use ZLIB.DEF instead. */
251 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
252 # define ZEXPORT WINAPI
254 # define ZEXPORTVA WINAPIV
256 # define ZEXPORTVA FAR CDECL
261 #if defined (__BEOS__)
263 # ifdef ZLIB_INTERNAL
264 # define ZEXPORT __declspec(dllexport)
265 # define ZEXPORTVA __declspec(dllexport)
267 # define ZEXPORT __declspec(dllimport)
268 # define ZEXPORTVA __declspec(dllimport)
274 # define ZEXTERN extern
287 #if !defined(__MACTYPES__)
288 typedef unsigned char Byte
; /* 8 bits */
290 typedef unsigned int uInt
; /* 16 bits or more */
291 typedef unsigned long uLong
; /* 32 bits or more */
294 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
295 # define Bytef Byte FAR
297 typedef Byte FAR Bytef
;
299 typedef char FAR charf
;
300 typedef int FAR intf
;
301 typedef uInt FAR uIntf
;
302 typedef uLong FAR uLongf
;
305 typedef void const *voidpc
;
306 typedef void FAR
*voidpf
;
309 typedef Byte
const *voidpc
;
310 typedef Byte FAR
*voidpf
;
314 #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
315 # include <sys/types.h> /* for off_t */
316 # include <unistd.h> /* for SEEK_* and off_t */
318 # include <unixio.h> /* for off_t */
320 # define z_off_t off_t
323 # define SEEK_SET 0 /* Seek from beginning of file. */
324 # define SEEK_CUR 1 /* Seek from current position. */
325 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
328 # define z_off_t long
331 #if defined(__OS400__)
332 # define NO_vsnprintf
336 # define NO_vsnprintf
342 /* MVS linker does not support external names larger than 8 bytes */
344 # pragma map(deflateInit_,"DEIN")
345 # pragma map(deflateInit2_,"DEIN2")
346 # pragma map(deflateEnd,"DEEND")
347 # pragma map(deflateBound,"DEBND")
348 # pragma map(inflateInit_,"ININ")
349 # pragma map(inflateInit2_,"ININ2")
350 # pragma map(inflateEnd,"INEND")
351 # pragma map(inflateSync,"INSY")
352 # pragma map(inflateSetDictionary,"INSEDI")
353 # pragma map(compressBound,"CMBND")
354 # pragma map(inflate_table,"INTABL")
355 # pragma map(inflate_fast,"INFA")
356 # pragma map(inflate_copyright,"INCOPY")