zconf.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. #include "cm_zlib_mangle.h"
  2. /* Disable some warnings so that we do not have to change the code much. */
  3. #if defined(CMZLIB_IN_C)
  4. # if defined(__BORLANDC__)
  5. # pragma warn -8004 /* Variable assigned a value that is not used. */
  6. # endif
  7. #endif
  8. /* zconf.h -- configuration of the zlib compression library
  9. * Copyright (C) 1995-2002 Jean-loup Gailly.
  10. * For conditions of distribution and use, see copyright notice in zlib.h
  11. */
  12. /* @(#) $Id$ */
  13. #ifndef _ZCONF_H
  14. #define _ZCONF_H
  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. */
  19. #ifdef Z_PREFIX
  20. # define deflateInit_ z_deflateInit_
  21. # define deflate z_deflate
  22. # define deflateEnd z_deflateEnd
  23. # define inflateInit_ z_inflateInit_
  24. # define inflate z_inflate
  25. # define inflateEnd z_inflateEnd
  26. # define deflateInit2_ z_deflateInit2_
  27. # define deflateSetDictionary z_deflateSetDictionary
  28. # define deflateCopy z_deflateCopy
  29. # define deflateReset z_deflateReset
  30. # define deflateParams z_deflateParams
  31. # define inflateInit2_ z_inflateInit2_
  32. # define inflateSetDictionary z_inflateSetDictionary
  33. # define inflateSync z_inflateSync
  34. # define inflateSyncPoint z_inflateSyncPoint
  35. # define inflateReset z_inflateReset
  36. # define compress z_compress
  37. # define compress2 z_compress2
  38. # define uncompress z_uncompress
  39. # define adler32 z_adler32
  40. # define crc32 z_crc32
  41. # define get_crc_table z_get_crc_table
  42. # define Byte z_Byte
  43. # define uInt z_uInt
  44. # define uLong z_uLong
  45. # define Bytef z_Bytef
  46. # define charf z_charf
  47. # define intf z_intf
  48. # define uIntf z_uIntf
  49. # define uLongf z_uLongf
  50. # define voidpf z_voidpf
  51. # define voidp z_voidp
  52. #endif
  53. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
  54. # define WIN32
  55. #endif
  56. #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
  57. # ifndef __32BIT__
  58. # define __32BIT__
  59. # endif
  60. #endif
  61. #if defined(__MSDOS__) && !defined(MSDOS)
  62. # define MSDOS
  63. #endif
  64. /*
  65. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  66. * than 64k bytes at a time (needed on systems with 16-bit int).
  67. */
  68. #if defined(MSDOS) && !defined(__32BIT__)
  69. # define MAXSEG_64K
  70. #endif
  71. #ifdef MSDOS
  72. # define UNALIGNED_OK
  73. #endif
  74. #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
  75. # define STDC
  76. #endif
  77. #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
  78. # ifndef STDC
  79. # define STDC
  80. # endif
  81. #endif
  82. #ifndef STDC
  83. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  84. # define const
  85. # endif
  86. #endif
  87. /* Some Mac compilers merge all .h files incorrectly: */
  88. #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
  89. # define NO_DUMMY_DECL
  90. #endif
  91. /* Old Borland C incorrectly complains about missing returns: */
  92. #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
  93. # define NEED_DUMMY_RETURN
  94. #endif
  95. /* Maximum value for memLevel in deflateInit2 */
  96. #ifndef MAX_MEM_LEVEL
  97. # ifdef MAXSEG_64K
  98. # define MAX_MEM_LEVEL 8
  99. # else
  100. # define MAX_MEM_LEVEL 9
  101. # endif
  102. #endif
  103. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  104. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  105. * created by gzip. (Files created by minigzip can still be extracted by
  106. * gzip.)
  107. */
  108. #ifndef MAX_WBITS
  109. # define MAX_WBITS 15 /* 32K LZ77 window */
  110. #endif
  111. /* The memory requirements for deflate are (in bytes):
  112. (1 << (windowBits+2)) + (1 << (memLevel+9))
  113. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  114. plus a few kilobytes for small objects. For example, if you want to reduce
  115. the default memory requirements from 256K to 128K, compile with
  116. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  117. Of course this will generally degrade compression (there's no free lunch).
  118. The memory requirements for inflate are (in bytes) 1 << windowBits
  119. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  120. for small objects.
  121. */
  122. /* Type declarations */
  123. #ifndef OF /* function prototypes */
  124. # ifdef STDC
  125. # define OF(args) args
  126. # else
  127. # define OF(args) ()
  128. # endif
  129. #endif
  130. /* The following definitions for FAR are needed only for MSDOS mixed
  131. * model programming (small or medium model with some far allocations).
  132. * This was tested only with MSC; for other MSDOS compilers you may have
  133. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  134. * just define FAR to be empty.
  135. */
  136. #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
  137. /* MSC small or medium model */
  138. # define SMALL_MEDIUM
  139. # ifdef _MSC_VER
  140. # define FAR _far
  141. # else
  142. # define FAR far
  143. # endif
  144. #endif
  145. #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
  146. # ifndef __32BIT__
  147. # define SMALL_MEDIUM
  148. # define FAR _far
  149. # endif
  150. #endif
  151. #include <cmzlib/zlibDllConfig.h>
  152. /* Compile with -DZLIB_DLL for Windows DLL support */
  153. #if defined(ZLIB_DLL)
  154. # if defined(NOTUSED_WINDOWS) || defined(NOTUSEDWINDOWS)
  155. # ifdef FAR
  156. # undef FAR
  157. # endif
  158. # include <windows.h>
  159. # define ZEXPORT WINAPI
  160. # ifdef WIN32
  161. # define ZEXPORTVA WINAPIV
  162. # else
  163. # define ZEXPORTVA FAR _cdecl _export
  164. # endif
  165. # endif
  166. # if defined (__BORLANDC__)
  167. # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
  168. # include <windows.h>
  169. # define ZEXPORT __declspec(dllexport) WINAPI
  170. # define ZEXPORTRVA __declspec(dllexport) WINAPIV
  171. # else
  172. # if defined (_Windows) && defined (__DLL__)
  173. # define ZEXPORT _export
  174. # define ZEXPORTVA _export
  175. # endif
  176. # endif
  177. # endif
  178. #endif
  179. #if defined (__BEOS__)
  180. # if defined (ZLIB_DLL)
  181. # define ZEXTERN extern __declspec(dllexport)
  182. # else
  183. # define ZEXTERN extern __declspec(dllimport)
  184. # endif
  185. #endif
  186. #ifndef ZEXPORT
  187. # define ZEXPORT
  188. #endif
  189. #ifndef ZEXPORTVA
  190. # define ZEXPORTVA
  191. #endif
  192. #ifndef ZEXTERN
  193. # define ZEXTERN extern
  194. #endif
  195. #ifndef FAR
  196. # define FAR
  197. #endif
  198. #if !defined(MACOS) && !defined(TARGET_OS_MAC)
  199. typedef unsigned char Byte; /* 8 bits */
  200. #endif
  201. typedef unsigned int uInt; /* 16 bits or more */
  202. typedef unsigned long uLong; /* 32 bits or more */
  203. #ifdef SMALL_MEDIUM
  204. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  205. # define Bytef Byte FAR
  206. #else
  207. typedef Byte FAR Bytef;
  208. #endif
  209. typedef char FAR charf;
  210. typedef int FAR intf;
  211. typedef uInt FAR uIntf;
  212. typedef uLong FAR uLongf;
  213. #ifdef STDC
  214. typedef void FAR *voidpf;
  215. typedef void *voidp;
  216. #else
  217. typedef Byte FAR *voidpf;
  218. typedef Byte *voidp;
  219. #endif
  220. #ifdef HAVE_UNISTD_H
  221. # include <sys/types.h> /* for off_t */
  222. # include <unistd.h> /* for SEEK_* and off_t */
  223. # define z_off_t off_t
  224. #endif
  225. #ifndef SEEK_SET
  226. # define SEEK_SET 0 /* Seek from beginning of file. */
  227. # define SEEK_CUR 1 /* Seek from current position. */
  228. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  229. #endif
  230. #ifndef z_off_t
  231. # define z_off_t long
  232. #endif
  233. /* MVS linker does not support external names larger than 8 bytes */
  234. #if defined(__MVS__)
  235. # pragma map(deflateInit_,"DEIN")
  236. # pragma map(deflateInit2_,"DEIN2")
  237. # pragma map(deflateEnd,"DEEND")
  238. # pragma map(inflateInit_,"ININ")
  239. # pragma map(inflateInit2_,"ININ2")
  240. # pragma map(inflateEnd,"INEND")
  241. # pragma map(inflateSync,"INSY")
  242. # pragma map(inflateSetDictionary,"INSEDI")
  243. # pragma map(inflate_blocks,"INBL")
  244. # pragma map(inflate_blocks_new,"INBLNE")
  245. # pragma map(inflate_blocks_free,"INBLFR")
  246. # pragma map(inflate_blocks_reset,"INBLRE")
  247. # pragma map(inflate_codes_free,"INCOFR")
  248. # pragma map(inflate_codes,"INCO")
  249. # pragma map(inflate_fast,"INFA")
  250. # pragma map(inflate_flush,"INFLU")
  251. # pragma map(inflate_mask,"INMA")
  252. # pragma map(inflate_set_dictionary,"INSEDI2")
  253. # pragma map(inflate_copyright,"INCOPY")
  254. # pragma map(inflate_trees_bits,"INTRBI")
  255. # pragma map(inflate_trees_dynamic,"INTRDY")
  256. # pragma map(inflate_trees_fixed,"INTRFI")
  257. # pragma map(inflate_trees_free,"INTRFR")
  258. #endif
  259. #if defined(_MSC_VER)
  260. #pragma warning ( disable : 4100 ) /* unreferenced variable */
  261. #pragma warning ( disable : 4127 ) /* cond expr is constant */
  262. #pragma warning ( disable : 4131 ) /* Old style declaration */
  263. #pragma warning ( disable : 4244 ) /* conversion loss of data */
  264. #pragma warning ( disable : 4267 )
  265. #endif
  266. #endif /* _ZCONF_H */