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