Debian Codegraph @

ext/zlib-ng/zconf.h.in

raw
1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6 #ifndef ZCONF_H
7 #define ZCONF_H
8
9 #include "zlib_name_mangling.h"
10
11 #if !defined(_WIN32) && defined(__WIN32__)
12 # define _WIN32
13 #endif
14
15 /* Clang macro for detecting declspec support
16 * https://clang.llvm.org/docs/LanguageExtensions.html#has-declspec-attribute
17 */
18 #ifndef __has_declspec_attribute
19 # define __has_declspec_attribute(x) 0
20 #endif
21
22 #if defined(ZLIB_CONST) && !defined(z_const)
23 # define z_const const
24 #else
25 # define z_const
26 #endif
27
28 /* Maximum value for memLevel in deflateInit2 */
29 #ifndef MAX_MEM_LEVEL
30 # define MAX_MEM_LEVEL 9
31 #endif
32
33 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
34 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
35 * created by gzip. (Files created by minigzip can still be extracted by
36 * gzip.)
37 */
38 #ifndef MAX_WBITS
39 # define MAX_WBITS 15 /* 32K LZ77 window */
40 #endif
41
42 /* The memory requirements for deflate are (in bytes):
43 (1 << (windowBits+2)) + (1 << (memLevel+9))
44 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
45 plus a few kilobytes for small objects. For example, if you want to reduce
46 the default memory requirements from 256K to 128K, compile with
47 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
48 Of course this will generally degrade compression (there's no free lunch).
49
50 The memory requirements for inflate are (in bytes) 1 << windowBits
51 that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
52 for small objects.
53 */
54
55 /* Type declarations */
56
57
58 #ifndef OF /* function prototypes */
59 # define OF(args) args
60 #endif
61
62 #ifdef ZLIB_INTERNAL
63 # define Z_INTERNAL ZLIB_INTERNAL
64 #endif
65
66 /* If building or using zlib as a DLL, define ZLIB_DLL.
67 * This is not mandatory, but it offers a little performance increase.
68 */
69 #if defined(ZLIB_DLL) && (defined(_WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)))
70 # ifdef Z_INTERNAL
71 # define Z_EXTERN extern __declspec(dllexport)
72 # else
73 # define Z_EXTERN extern __declspec(dllimport)
74 # endif
75 #endif
76
77 /* If building or using zlib with the WINAPI/WINAPIV calling convention,
78 * define ZLIB_WINAPI.
79 * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
80 */
81 #if defined(ZLIB_WINAPI) && defined(_WIN32)
82 # include <windows.h>
83 /* No need for _export, use ZLIB.DEF instead. */
84 /* For complete Windows compatibility, use WINAPI, not __stdcall. */
85 # define Z_EXPORT WINAPI
86 # define Z_EXPORTVA WINAPIV
87 #endif
88
89 #ifndef Z_EXTERN
90 # define Z_EXTERN extern
91 #endif
92 #ifndef Z_EXPORT
93 # define Z_EXPORT
94 #endif
95 #ifndef Z_EXPORTVA
96 # define Z_EXPORTVA
97 #endif
98
99 /* Conditional exports */
100 #define ZNG_CONDEXPORT Z_INTERNAL
101
102 /* For backwards compatibility */
103
104 #ifndef ZEXTERN
105 # define ZEXTERN Z_EXTERN
106 #endif
107 #ifndef ZEXPORT
108 # define ZEXPORT Z_EXPORT
109 #endif
110 #ifndef ZEXPORTVA
111 # define ZEXPORTVA Z_EXPORTVA
112 #endif
113
114 /* Legacy zlib typedefs for backwards compatibility. Don't assume stdint.h is defined. */
115 typedef unsigned char Byte;
116 typedef Byte Bytef;
117
118 typedef unsigned int uInt; /* 16 bits or more */
119 typedef unsigned long uLong; /* 32 bits or more */
120
121 typedef char charf;
122 typedef int intf;
123 typedef uInt uIntf;
124 typedef uLong uLongf;
125
126 typedef void const *voidpc;
127 typedef void *voidpf;
128 typedef void *voidp;
129
130 typedef unsigned int z_crc_t;
131
132 #ifdef HAVE_UNISTD_H /* may be set to #if 1 by configure/cmake/etc */
133 # define Z_HAVE_UNISTD_H
134 #endif
135
136 #ifdef NEED_PTRDIFF_T /* may be set to #if 1 by configure/cmake/etc */
137 typedef PTRDIFF_TYPE ptrdiff_t;
138 #endif
139
140 #include <sys/types.h> /* for off_t */
141
142 #include <stddef.h> /* for wchar_t and NULL */
143
144 /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
145 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
146 * though the former does not conform to the LFS document), but considering
147 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
148 * equivalently requesting no 64-bit operations
149 */
150 #if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
151 # undef _LARGEFILE64_SOURCE
152 #endif
153
154 #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
155 # include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
156 # ifndef z_off_t
157 # define z_off_t off_t
158 # endif
159 #endif
160
161 #if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
162 # define Z_LFS64
163 #endif
164
165 #if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
166 # define Z_LARGE64
167 #endif
168
169 #if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
170 # define Z_WANT64
171 #endif
172
173 #if !defined(SEEK_SET)
174 # define SEEK_SET 0 /* Seek from beginning of file. */
175 # define SEEK_CUR 1 /* Seek from current position. */
176 # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
177 #endif
178
179 #ifndef z_off_t
180 # define z_off_t long
181 #endif
182
183 #if !defined(_WIN32) && defined(Z_LARGE64)
184 # define z_off64_t off64_t
185 #else
186 # if defined(__MSYS__)
187 # define z_off64_t _off64_t
188 # elif defined(_WIN32) && !defined(__GNUC__)
189 # define z_off64_t __int64
190 # else
191 # define z_off64_t z_off_t
192 # endif
193 #endif
194
195 #endif /* ZCONF_H */