zconf.h 10 KB

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