Debian Codegraph @

ext/zlib-ng/zconf-ng.h.in

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