zconf.h 10 KB

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