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