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