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