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