zconf.h 16 KB

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