Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / diskimage / z_library / include / zconf.h
blob7b97dacd45ca287ef8583ef8d64e696ba7298d87
1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2010 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
6 /* @(#) $Id$ */
8 #ifndef ZCONF_H
9 #define ZCONF_H
12 * If you *really* need a unique prefix for all types and library functions,
13 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14 * Even better than compiling with -DZ_PREFIX would be to use configure to set
15 * this permanently in zconf.h using "./configure --zprefix".
17 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
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_block z__tr_flush_block
24 # define _tr_init z__tr_init
25 # define _tr_stored_block z__tr_stored_block
26 # define _tr_tally z__tr_tally
27 # define adler32 z_adler32
28 # define adler32_combine z_adler32_combine
29 # define adler32_combine64 z_adler32_combine64
30 # define compress z_compress
31 # define compress2 z_compress2
32 # define compressBound z_compressBound
33 # define crc32 z_crc32
34 # define crc32_combine z_crc32_combine
35 # define crc32_combine64 z_crc32_combine64
36 # define deflate z_deflate
37 # define deflateBound z_deflateBound
38 # define deflateCopy z_deflateCopy
39 # define deflateEnd z_deflateEnd
40 # define deflateInit2_ z_deflateInit2_
41 # define deflateInit_ z_deflateInit_
42 # define deflateParams z_deflateParams
43 # define deflatePrime z_deflatePrime
44 # define deflateReset z_deflateReset
45 # define deflateSetDictionary z_deflateSetDictionary
46 # define deflateSetHeader z_deflateSetHeader
47 # define deflateTune z_deflateTune
48 # define deflate_copyright z_deflate_copyright
49 # define get_crc_table z_get_crc_table
50 # define gz_error z_gz_error
51 # define gz_intmax z_gz_intmax
52 # define gz_strwinerror z_gz_strwinerror
53 # define gzbuffer z_gzbuffer
54 # define gzclearerr z_gzclearerr
55 # define gzclose z_gzclose
56 # define gzclose_r z_gzclose_r
57 # define gzclose_w z_gzclose_w
58 # define gzdirect z_gzdirect
59 # define gzdopen z_gzdopen
60 # define gzeof z_gzeof
61 # define gzerror z_gzerror
62 # define gzflush z_gzflush
63 # define gzgetc z_gzgetc
64 # define gzgets z_gzgets
65 # define gzoffset z_gzoffset
66 # define gzoffset64 z_gzoffset64
67 # define gzopen z_gzopen
68 # define gzopen64 z_gzopen64
69 # define gzprintf z_gzprintf
70 # define gzputc z_gzputc
71 # define gzputs z_gzputs
72 # define gzread z_gzread
73 # define gzrewind z_gzrewind
74 # define gzseek z_gzseek
75 # define gzseek64 z_gzseek64
76 # define gzsetparams z_gzsetparams
77 # define gztell z_gztell
78 # define gztell64 z_gztell64
79 # define gzungetc z_gzungetc
80 # define gzwrite z_gzwrite
81 # define inflate z_inflate
82 # define inflateBack z_inflateBack
83 # define inflateBackEnd z_inflateBackEnd
84 # define inflateBackInit_ z_inflateBackInit_
85 # define inflateCopy z_inflateCopy
86 # define inflateEnd z_inflateEnd
87 # define inflateGetHeader z_inflateGetHeader
88 # define inflateInit2_ z_inflateInit2_
89 # define inflateInit_ z_inflateInit_
90 # define inflateMark z_inflateMark
91 # define inflatePrime z_inflatePrime
92 # define inflateReset z_inflateReset
93 # define inflateReset2 z_inflateReset2
94 # define inflateSetDictionary z_inflateSetDictionary
95 # define inflateSync z_inflateSync
96 # define inflateSyncPoint z_inflateSyncPoint
97 # define inflateUndermine z_inflateUndermine
98 # define inflate_copyright z_inflate_copyright
99 # define inflate_fast z_inflate_fast
100 # define inflate_table z_inflate_table
101 # define uncompress z_uncompress
102 # define zError z_zError
103 # define zcalloc z_zcalloc
104 # define zcfree z_zcfree
105 # define zlibCompileFlags z_zlibCompileFlags
106 # define zlibVersion z_zlibVersion
108 /* all zlib typedefs in zlib.h and zconf.h */
109 # define Byte z_Byte
110 # define Bytef z_Bytef
111 # define alloc_func z_alloc_func
112 # define charf z_charf
113 # define free_func z_free_func
114 # define gzFile z_gzFile
115 # define gz_header z_gz_header
116 # define gz_headerp z_gz_headerp
117 # define in_func z_in_func
118 # define intf z_intf
119 # define out_func z_out_func
120 # define uInt z_uInt
121 # define uIntf z_uIntf
122 # define uLong z_uLong
123 # define uLongf z_uLongf
124 # define voidp z_voidp
125 # define voidpc z_voidpc
126 # define voidpf z_voidpf
128 /* all zlib structs in zlib.h and zconf.h */
129 # define gz_header_s z_gz_header_s
130 # define internal_state z_internal_state
132 #endif
134 #if defined(__MSDOS__) && !defined(MSDOS)
135 # define MSDOS
136 #endif
137 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
138 # define OS2
139 #endif
140 #if defined(_WINDOWS) && !defined(WINDOWS)
141 # define WINDOWS
142 #endif
143 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
144 # ifndef WIN32
145 # define WIN32
146 # endif
147 #endif
148 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
149 # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
150 # ifndef SYS16BIT
151 # define SYS16BIT
152 # endif
153 # endif
154 #endif
157 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
158 * than 64k bytes at a time (needed on systems with 16-bit int).
160 #ifdef SYS16BIT
161 # define MAXSEG_64K
162 #endif
163 #ifdef MSDOS
164 # define UNALIGNED_OK
165 #endif
167 #ifdef __STDC_VERSION__
168 # ifndef STDC
169 # define STDC
170 # endif
171 # if __STDC_VERSION__ >= 199901L
172 # ifndef STDC99
173 # define STDC99
174 # endif
175 # endif
176 #endif
177 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
178 # define STDC
179 #endif
180 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
181 # define STDC
182 #endif
183 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
184 # define STDC
185 #endif
186 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
187 # define STDC
188 #endif
190 #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
191 # define STDC
192 #endif
194 #ifndef STDC
195 # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
196 # define const /* note: need a more gentle solution here */
197 # endif
198 #endif
200 /* Some Mac compilers merge all .h files incorrectly: */
201 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
202 # define NO_DUMMY_DECL
203 #endif
205 /* Maximum value for memLevel in deflateInit2 */
206 #ifndef MAX_MEM_LEVEL
207 # ifdef MAXSEG_64K
208 # define MAX_MEM_LEVEL 8
209 # else
210 # define MAX_MEM_LEVEL 9
211 # endif
212 #endif
214 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
215 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
216 * created by gzip. (Files created by minigzip can still be extracted by
217 * gzip.)
219 #ifndef MAX_WBITS
220 # define MAX_WBITS 15 /* 32K LZ77 window */
221 #endif
223 /* The memory requirements for deflate are (in bytes):
224 (1 << (windowBits+2)) + (1 << (memLevel+9))
225 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
226 plus a few kilobytes for small objects. For example, if you want to reduce
227 the default memory requirements from 256K to 128K, compile with
228 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
229 Of course this will generally degrade compression (there's no free lunch).
231 The memory requirements for inflate are (in bytes) 1 << windowBits
232 that is, 32K for windowBits=15 (default value) plus a few kilobytes
233 for small objects.
236 /* Type declarations */
238 #ifndef OF /* function prototypes */
239 # ifdef STDC
240 # define OF(args) args
241 # else
242 # define OF(args) ()
243 # endif
244 #endif
246 /* The following definitions for FAR are needed only for MSDOS mixed
247 * model programming (small or medium model with some far allocations).
248 * This was tested only with MSC; for other MSDOS compilers you may have
249 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
250 * just define FAR to be empty.
252 #ifdef SYS16BIT
253 # if defined(M_I86SM) || defined(M_I86MM)
254 /* MSC small or medium model */
255 # define SMALL_MEDIUM
256 # ifdef _MSC_VER
257 # define FAR _far
258 # else
259 # define FAR far
260 # endif
261 # endif
262 # if (defined(__SMALL__) || defined(__MEDIUM__))
263 /* Turbo C small or medium model */
264 # define SMALL_MEDIUM
265 # ifdef __BORLANDC__
266 # define FAR _far
267 # else
268 # define FAR far
269 # endif
270 # endif
271 #endif
273 #if defined(WINDOWS) || defined(WIN32)
274 /* If building or using zlib as a DLL, define ZLIB_DLL.
275 * This is not mandatory, but it offers a little performance increase.
277 # ifdef ZLIB_DLL
278 # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
279 # ifdef ZLIB_INTERNAL
280 # define ZEXTERN extern __declspec(dllexport)
281 # else
282 # define ZEXTERN extern __declspec(dllimport)
283 # endif
284 # endif
285 # endif /* ZLIB_DLL */
286 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
287 * define ZLIB_WINAPI.
288 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
290 # ifdef ZLIB_WINAPI
291 # ifdef FAR
292 # undef FAR
293 # endif
294 # include <windows.h>
295 /* No need for _export, use ZLIB.DEF instead. */
296 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
297 # define ZEXPORT WINAPI
298 # ifdef WIN32
299 # define ZEXPORTVA WINAPIV
300 # else
301 # define ZEXPORTVA FAR CDECL
302 # endif
303 # endif
304 #endif
306 #if defined (__BEOS__)
307 # ifdef ZLIB_DLL
308 # ifdef ZLIB_INTERNAL
309 # define ZEXPORT __declspec(dllexport)
310 # define ZEXPORTVA __declspec(dllexport)
311 # else
312 # define ZEXPORT __declspec(dllimport)
313 # define ZEXPORTVA __declspec(dllimport)
314 # endif
315 # endif
316 #endif
318 #ifdef HAVE_VISIBILITY_PRAGMA
319 # define ZEXTERN __attribute__((visibility ("default"))) extern
320 #endif
322 #ifndef ZEXTERN
323 # define ZEXTERN extern
324 #endif
325 #ifndef ZEXPORT
326 # define ZEXPORT
327 #endif
328 #ifndef ZEXPORTVA
329 # define ZEXPORTVA
330 #endif
332 #ifndef FAR
333 # define FAR
334 #endif
336 #ifdef AMIGA
337 #include <exec/types.h>
338 typedef UBYTE Byte;
339 typedef ULONG uInt;
340 typedef ULONG uLong;
341 #else
342 #if !defined(__MACTYPES__)
343 typedef unsigned char Byte; /* 8 bits */
344 #endif
345 typedef unsigned int uInt; /* 16 bits or more */
346 typedef unsigned long uLong; /* 32 bits or more */
347 #endif
349 #ifdef SMALL_MEDIUM
350 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
351 # define Bytef Byte FAR
352 #else
353 typedef Byte FAR Bytef;
354 #endif
355 typedef char FAR charf;
356 typedef int FAR intf;
357 typedef uInt FAR uIntf;
358 typedef uLong FAR uLongf;
360 #ifdef STDC
361 typedef void const *voidpc;
362 typedef void FAR *voidpf;
363 typedef void *voidp;
364 #else
365 typedef Byte const *voidpc;
366 typedef Byte FAR *voidpf;
367 typedef Byte *voidp;
368 #endif
370 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
371 # define Z_HAVE_UNISTD_H
372 #endif
374 #ifdef Z_HAVE_UNISTD_H
375 # include <sys/types.h> /* for off_t */
376 # include <unistd.h> /* for SEEK_* and off_t */
377 # ifdef VMS
378 # include <unixio.h> /* for off_t */
379 # endif
380 # ifndef z_off_t
381 # define z_off_t off_t
382 # endif
383 #endif
385 #ifdef _LARGEFILE64_SOURCE
386 # include <sys/types.h>
387 #endif
389 #ifndef SEEK_SET
390 # define SEEK_SET 0 /* Seek from beginning of file. */
391 # define SEEK_CUR 1 /* Seek from current position. */
392 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
393 #endif
394 #ifndef z_off_t
395 # define z_off_t long
396 #endif
398 #if defined(__OS400__)
399 # define NO_vsnprintf
400 #endif
402 #if defined(__MVS__)
403 # define NO_vsnprintf
404 #endif
406 /* MVS linker does not support external names larger than 8 bytes */
407 #if defined(__MVS__)
408 #pragma map(deflateInit_,"DEIN")
409 #pragma map(deflateInit2_,"DEIN2")
410 #pragma map(deflateEnd,"DEEND")
411 #pragma map(deflateBound,"DEBND")
412 #pragma map(inflateInit_,"ININ")
413 #pragma map(inflateInit2_,"ININ2")
414 #pragma map(inflateEnd,"INEND")
415 #pragma map(inflateSync,"INSY")
416 #pragma map(inflateSetDictionary,"INSEDI")
417 #pragma map(compressBound,"CMBND")
418 #pragma map(inflate_table,"INTABL")
419 #pragma map(inflate_fast,"INFA")
420 #pragma map(inflate_copyright,"INCOPY")
421 #endif
423 #endif /* ZCONF_H */