]> git.saurik.com Git - wxWidgets.git/blame - src/zlib/zconf.h
OSX_ARCH_OPTS also needs to be added to CPPFLAGS.
[wxWidgets.git] / src / zlib / zconf.h
CommitLineData
c801d85f 1/* zconf.h -- configuration of the zlib compression library
772513d8 2 * Copyright (C) 1995-2013 Jean-loup Gailly.
e6ebb514 3 * For conditions of distribution and use, see copyright notice in zlib.h
c801d85f
KB
4 */
5
c801d85f 6
51dbdf87
VS
7#ifndef ZCONF_H
8#define ZCONF_H
c801d85f
KB
9
10/*
11 * If you *really* need a unique prefix for all types and library functions,
12 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
772513d8
VZ
13 * Even better than compiling with -DZ_PREFIX would be to use configure to set
14 * this permanently in zconf.h using "./configure --zprefix".
c801d85f 15 */
772513d8
VZ
16#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
17# define Z_PREFIX_SET
18
19/* all linked symbols */
20# define _dist_code z__dist_code
21# define _length_code z__length_code
22# define _tr_align z__tr_align
23# define _tr_flush_bits z__tr_flush_bits
24# define _tr_flush_block z__tr_flush_block
25# define _tr_init z__tr_init
26# define _tr_stored_block z__tr_stored_block
27# define _tr_tally z__tr_tally
28# define adler32 z_adler32
29# define adler32_combine z_adler32_combine
30# define adler32_combine64 z_adler32_combine64
31# ifndef Z_SOLO
32# define compress z_compress
33# define compress2 z_compress2
34# define compressBound z_compressBound
35# endif
36# define crc32 z_crc32
37# define crc32_combine z_crc32_combine
38# define crc32_combine64 z_crc32_combine64
ba0052f3 39# define deflate z_deflate
772513d8
VZ
40# define deflateBound z_deflateBound
41# define deflateCopy z_deflateCopy
ba0052f3 42# define deflateEnd z_deflateEnd
ba0052f3 43# define deflateInit2_ z_deflateInit2_
772513d8 44# define deflateInit_ z_deflateInit_
ba0052f3 45# define deflateParams z_deflateParams
772513d8 46# define deflatePending z_deflatePending
ba0052f3 47# define deflatePrime z_deflatePrime
772513d8
VZ
48# define deflateReset z_deflateReset
49# define deflateResetKeep z_deflateResetKeep
50# define deflateSetDictionary z_deflateSetDictionary
51# define deflateSetHeader z_deflateSetHeader
52# define deflateTune z_deflateTune
53# define deflate_copyright z_deflate_copyright
54# define get_crc_table z_get_crc_table
55# ifndef Z_SOLO
56# define gz_error z_gz_error
57# define gz_intmax z_gz_intmax
58# define gz_strwinerror z_gz_strwinerror
59# define gzbuffer z_gzbuffer
60# define gzclearerr z_gzclearerr
61# define gzclose z_gzclose
62# define gzclose_r z_gzclose_r
63# define gzclose_w z_gzclose_w
64# define gzdirect z_gzdirect
65# define gzdopen z_gzdopen
66# define gzeof z_gzeof
67# define gzerror z_gzerror
68# define gzflush z_gzflush
69# define gzgetc z_gzgetc
70# define gzgetc_ z_gzgetc_
71# define gzgets z_gzgets
72# define gzoffset z_gzoffset
73# define gzoffset64 z_gzoffset64
74# define gzopen z_gzopen
75# define gzopen64 z_gzopen64
76# ifdef _WIN32
77# define gzopen_w z_gzopen_w
78# endif
79# define gzprintf z_gzprintf
80# define gzvprintf z_gzvprintf
81# define gzputc z_gzputc
82# define gzputs z_gzputs
83# define gzread z_gzread
84# define gzrewind z_gzrewind
85# define gzseek z_gzseek
86# define gzseek64 z_gzseek64
87# define gzsetparams z_gzsetparams
88# define gztell z_gztell
89# define gztell64 z_gztell64
90# define gzungetc z_gzungetc
91# define gzwrite z_gzwrite
92# endif
93# define inflate z_inflate
94# define inflateBack z_inflateBack
95# define inflateBackEnd z_inflateBackEnd
96# define inflateBackInit_ z_inflateBackInit_
97# define inflateCopy z_inflateCopy
98# define inflateEnd z_inflateEnd
99# define inflateGetHeader z_inflateGetHeader
ba0052f3 100# define inflateInit2_ z_inflateInit2_
772513d8
VZ
101# define inflateInit_ z_inflateInit_
102# define inflateMark z_inflateMark
103# define inflatePrime z_inflatePrime
104# define inflateReset z_inflateReset
105# define inflateReset2 z_inflateReset2
ba0052f3 106# define inflateSetDictionary z_inflateSetDictionary
772513d8 107# define inflateGetDictionary z_inflateGetDictionary
ba0052f3
VS
108# define inflateSync z_inflateSync
109# define inflateSyncPoint z_inflateSyncPoint
772513d8
VZ
110# define inflateUndermine z_inflateUndermine
111# define inflateResetKeep z_inflateResetKeep
112# define inflate_copyright z_inflate_copyright
113# define inflate_fast z_inflate_fast
114# define inflate_table z_inflate_table
115# ifndef Z_SOLO
116# define uncompress z_uncompress
117# endif
ba0052f3 118# define zError z_zError
772513d8
VZ
119# ifndef Z_SOLO
120# define zcalloc z_zcalloc
121# define zcfree z_zcfree
122# endif
123# define zlibCompileFlags z_zlibCompileFlags
124# define zlibVersion z_zlibVersion
c801d85f 125
772513d8
VZ
126/* all zlib typedefs in zlib.h and zconf.h */
127# define Byte z_Byte
128# define Bytef z_Bytef
41faf807 129# define alloc_func z_alloc_func
772513d8 130# define charf z_charf
41faf807 131# define free_func z_free_func
772513d8
VZ
132# ifndef Z_SOLO
133# define gzFile z_gzFile
134# endif
135# define gz_header z_gz_header
136# define gz_headerp z_gz_headerp
41faf807 137# define in_func z_in_func
772513d8 138# define intf z_intf
41faf807 139# define out_func z_out_func
ba0052f3 140# define uInt z_uInt
ba0052f3 141# define uIntf z_uIntf
772513d8 142# define uLong z_uLong
ba0052f3 143# define uLongf z_uLongf
ba0052f3 144# define voidp z_voidp
772513d8
VZ
145# define voidpc z_voidpc
146# define voidpf z_voidpf
147
148/* all zlib structs in zlib.h and zconf.h */
149# define gz_header_s z_gz_header_s
150# define internal_state z_internal_state
151
c801d85f
KB
152#endif
153
51dbdf87
VS
154#if defined(__MSDOS__) && !defined(MSDOS)
155# define MSDOS
156#endif
157#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
158# define OS2
159#endif
160#if defined(_WINDOWS) && !defined(WINDOWS)
161# define WINDOWS
162#endif
41faf807
MW
163#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
164# ifndef WIN32
165# define WIN32
166# endif
c801d85f 167#endif
51dbdf87
VS
168#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
169# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
170# ifndef SYS16BIT
171# define SYS16BIT
172# endif
c801d85f
KB
173# endif
174#endif
c801d85f
KB
175
176/*
177 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
178 * than 64k bytes at a time (needed on systems with 16-bit int).
179 */
51dbdf87 180#ifdef SYS16BIT
c801d85f
KB
181# define MAXSEG_64K
182#endif
183#ifdef MSDOS
184# define UNALIGNED_OK
185#endif
186
51dbdf87 187#ifdef __STDC_VERSION__
c801d85f
KB
188# ifndef STDC
189# define STDC
190# endif
51dbdf87
VS
191# if __STDC_VERSION__ >= 199901L
192# ifndef STDC99
193# define STDC99
194# endif
195# endif
196#endif
197#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
198# define STDC
199#endif
200#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
201# define STDC
202#endif
203#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
204# define STDC
205#endif
206#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
207# define STDC
208#endif
209
210#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
211# define STDC
c801d85f
KB
212#endif
213
214#ifndef STDC
215# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
51dbdf87 216# define const /* note: need a more gentle solution here */
c801d85f
KB
217# endif
218#endif
219
772513d8
VZ
220#if defined(ZLIB_CONST) && !defined(z_const)
221# define z_const const
222#else
223# define z_const
224#endif
225
c801d85f 226/* Some Mac compilers merge all .h files incorrectly: */
51dbdf87 227#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
c801d85f
KB
228# define NO_DUMMY_DECL
229#endif
230
c801d85f
KB
231/* Maximum value for memLevel in deflateInit2 */
232#ifndef MAX_MEM_LEVEL
233# ifdef MAXSEG_64K
234# define MAX_MEM_LEVEL 8
235# else
236# define MAX_MEM_LEVEL 9
237# endif
238#endif
239
240/* Maximum value for windowBits in deflateInit2 and inflateInit2.
241 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
242 * created by gzip. (Files created by minigzip can still be extracted by
243 * gzip.)
244 */
245#ifndef MAX_WBITS
246# define MAX_WBITS 15 /* 32K LZ77 window */
247#endif
248
249/* The memory requirements for deflate are (in bytes):
250 (1 << (windowBits+2)) + (1 << (memLevel+9))
251 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
252 plus a few kilobytes for small objects. For example, if you want to reduce
253 the default memory requirements from 256K to 128K, compile with
254 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
255 Of course this will generally degrade compression (there's no free lunch).
256
257 The memory requirements for inflate are (in bytes) 1 << windowBits
258 that is, 32K for windowBits=15 (default value) plus a few kilobytes
259 for small objects.
260*/
261
262 /* Type declarations */
263
264#ifndef OF /* function prototypes */
265# ifdef STDC
266# define OF(args) args
267# else
268# define OF(args) ()
269# endif
270#endif
271
772513d8
VZ
272#ifndef Z_ARG /* function prototypes for stdarg */
273# if defined(STDC) || defined(Z_HAVE_STDARG_H)
274# define Z_ARG(args) args
275# else
276# define Z_ARG(args) ()
277# endif
278#endif
279
c801d85f
KB
280/* The following definitions for FAR are needed only for MSDOS mixed
281 * model programming (small or medium model with some far allocations).
282 * This was tested only with MSC; for other MSDOS compilers you may have
283 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
284 * just define FAR to be empty.
285 */
51dbdf87
VS
286#ifdef SYS16BIT
287# if defined(M_I86SM) || defined(M_I86MM)
288 /* MSC small or medium model */
289# define SMALL_MEDIUM
290# ifdef _MSC_VER
291# define FAR _far
292# else
293# define FAR far
294# endif
c801d85f 295# endif
51dbdf87
VS
296# if (defined(__SMALL__) || defined(__MEDIUM__))
297 /* Turbo C small or medium model */
c801d85f 298# define SMALL_MEDIUM
51dbdf87
VS
299# ifdef __BORLANDC__
300# define FAR _far
301# else
302# define FAR far
303# endif
c801d85f
KB
304# endif
305#endif
306
51dbdf87
VS
307#if defined(WINDOWS) || defined(WIN32)
308 /* If building or using zlib as a DLL, define ZLIB_DLL.
309 * This is not mandatory, but it offers a little performance increase.
310 */
311# ifdef ZLIB_DLL
312# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
313# ifdef ZLIB_INTERNAL
314# define ZEXTERN extern __declspec(dllexport)
315# else
316# define ZEXTERN extern __declspec(dllimport)
a4019ec2
SC
317# endif
318# endif
51dbdf87
VS
319# endif /* ZLIB_DLL */
320 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
321 * define ZLIB_WINAPI.
322 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
323 */
324# ifdef ZLIB_WINAPI
325# ifdef FAR
326# undef FAR
327# endif
328# include <windows.h>
329 /* No need for _export, use ZLIB.DEF instead. */
330 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
331# define ZEXPORT WINAPI
332# ifdef WIN32
333# define ZEXPORTVA WINAPIV
334# else
335# define ZEXPORTVA FAR CDECL
336# endif
a4019ec2
SC
337# endif
338#endif
339
340#if defined (__BEOS__)
51dbdf87
VS
341# ifdef ZLIB_DLL
342# ifdef ZLIB_INTERNAL
343# define ZEXPORT __declspec(dllexport)
344# define ZEXPORTVA __declspec(dllexport)
345# else
346# define ZEXPORT __declspec(dllimport)
347# define ZEXPORTVA __declspec(dllimport)
348# endif
a4019ec2
SC
349# endif
350#endif
351
51dbdf87
VS
352#ifndef ZEXTERN
353# define ZEXTERN extern
354#endif
a4019ec2 355#ifndef ZEXPORT
51dbdf87 356# define ZEXPORT
a4019ec2
SC
357#endif
358#ifndef ZEXPORTVA
51dbdf87 359# define ZEXPORTVA
c801d85f
KB
360#endif
361
362#ifndef FAR
51dbdf87 363# define FAR
c801d85f
KB
364#endif
365
51dbdf87 366#if !defined(__MACTYPES__)
c801d85f 367typedef unsigned char Byte; /* 8 bits */
a4019ec2 368#endif
c801d85f
KB
369typedef unsigned int uInt; /* 16 bits or more */
370typedef unsigned long uLong; /* 32 bits or more */
371
a4019ec2
SC
372#ifdef SMALL_MEDIUM
373 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
c801d85f
KB
374# define Bytef Byte FAR
375#else
376 typedef Byte FAR Bytef;
377#endif
378typedef char FAR charf;
379typedef int FAR intf;
380typedef uInt FAR uIntf;
381typedef uLong FAR uLongf;
382
383#ifdef STDC
51dbdf87
VS
384 typedef void const *voidpc;
385 typedef void FAR *voidpf;
386 typedef void *voidp;
c801d85f 387#else
51dbdf87
VS
388 typedef Byte const *voidpc;
389 typedef Byte FAR *voidpf;
390 typedef Byte *voidp;
c801d85f
KB
391#endif
392
772513d8
VZ
393#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
394# include <limits.h>
395# if (UINT_MAX == 0xffffffffUL)
396# define Z_U4 unsigned
397# elif (ULONG_MAX == 0xffffffffUL)
398# define Z_U4 unsigned long
399# elif (USHRT_MAX == 0xffffffffUL)
400# define Z_U4 unsigned short
401# endif
402#endif
403
404#ifdef Z_U4
405 typedef Z_U4 z_crc_t;
406#else
407 typedef unsigned long z_crc_t;
408#endif
409
410#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
411# define Z_HAVE_UNISTD_H
412#endif
413
414#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
415# define Z_HAVE_STDARG_H
416#endif
417
418#ifdef STDC
419# ifndef Z_SOLO
420# include <sys/types.h> /* for off_t */
421# endif
422#endif
423
424#if defined(STDC) || defined(Z_HAVE_STDARG_H)
425# ifndef Z_SOLO
426# include <stdarg.h> /* for va_list */
51dbdf87 427# endif
c801d85f 428#endif
772513d8
VZ
429
430#ifdef _WIN32
431# ifndef Z_SOLO
432# include <stddef.h> /* for wchar_t */
433# endif
434#endif
435
436/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
437 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
438 * though the former does not conform to the LFS document), but considering
439 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
440 * equivalently requesting no 64-bit operations
441 */
442#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
443# undef _LARGEFILE64_SOURCE
444#endif
445
446#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
447# define Z_HAVE_UNISTD_H
448#endif
449#ifndef Z_SOLO
450# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
451# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
452# ifdef VMS
453# include <unixio.h> /* for off_t */
454# endif
455# ifndef z_off_t
456# define z_off_t off_t
457# endif
458# endif
459#endif
460
461#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
462# define Z_LFS64
463#endif
464
465#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
466# define Z_LARGE64
467#endif
468
469#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
470# define Z_WANT64
471#endif
472
473#if !defined(SEEK_SET) && !defined(Z_SOLO)
c801d85f
KB
474# define SEEK_SET 0 /* Seek from beginning of file. */
475# define SEEK_CUR 1 /* Seek from current position. */
a4019ec2 476# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
c801d85f 477#endif
772513d8 478
c801d85f 479#ifndef z_off_t
ba0052f3 480# define z_off_t long
c801d85f
KB
481#endif
482
772513d8
VZ
483#if !defined(_WIN32) && defined(Z_LARGE64)
484# define z_off64_t off64_t
485#else
486# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
487# define z_off64_t __int64
488# else
489# define z_off64_t z_off_t
51dbdf87
VS
490# endif
491#endif
492
c801d85f
KB
493/* MVS linker does not support external names larger than 8 bytes */
494#if defined(__MVS__)
772513d8
VZ
495 #pragma map(deflateInit_,"DEIN")
496 #pragma map(deflateInit2_,"DEIN2")
497 #pragma map(deflateEnd,"DEEND")
498 #pragma map(deflateBound,"DEBND")
499 #pragma map(inflateInit_,"ININ")
500 #pragma map(inflateInit2_,"ININ2")
501 #pragma map(inflateEnd,"INEND")
502 #pragma map(inflateSync,"INSY")
503 #pragma map(inflateSetDictionary,"INSEDI")
504 #pragma map(compressBound,"CMBND")
505 #pragma map(inflate_table,"INTABL")
506 #pragma map(inflate_fast,"INFA")
507 #pragma map(inflate_copyright,"INCOPY")
c801d85f
KB
508#endif
509
51dbdf87 510#endif /* ZCONF_H */