diff options
Diffstat (limited to 'zutil.h')
-rw-r--r-- | zutil.h | 35 |
1 files changed, 20 insertions, 15 deletions
@@ -15,11 +15,7 @@ | |||
15 | 15 | ||
16 | #include "zlib.h" | 16 | #include "zlib.h" |
17 | 17 | ||
18 | /* #ifndef __GNUC__ disable inline for now */ | 18 | #if defined(MSDOS) || defined(VMS) |
19 | # define inline | ||
20 | /* #endif */ | ||
21 | |||
22 | #ifdef MSDOS | ||
23 | # include <stddef.h> | 19 | # include <stddef.h> |
24 | # include <errno.h> | 20 | # include <errno.h> |
25 | #else | 21 | #else |
@@ -35,7 +31,9 @@ | |||
35 | /* compile with -Dlocal if your debugger can't find static symbols */ | 31 | /* compile with -Dlocal if your debugger can't find static symbols */ |
36 | 32 | ||
37 | typedef unsigned char uch; | 33 | typedef unsigned char uch; |
34 | typedef uch FAR uchf; | ||
38 | typedef unsigned short ush; | 35 | typedef unsigned short ush; |
36 | typedef ush FAR ushf; | ||
39 | typedef unsigned long ulg; | 37 | typedef unsigned long ulg; |
40 | 38 | ||
41 | extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | 39 | extern char *z_errmsg[]; /* indexed by 1-zlib_error */ |
@@ -47,7 +45,9 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | |||
47 | 45 | ||
48 | #define DEFLATED 8 | 46 | #define DEFLATED 8 |
49 | 47 | ||
50 | #define DEF_WBITS 15 | 48 | #ifndef DEF_WBITS |
49 | # define DEF_WBITS 15 | ||
50 | #endif | ||
51 | /* default windowBits for decompression. MAX_WBITS is for compression only */ | 51 | /* default windowBits for decompression. MAX_WBITS is for compression only */ |
52 | 52 | ||
53 | #if MAX_MEM_LEVEL >= 8 | 53 | #if MAX_MEM_LEVEL >= 8 |
@@ -124,7 +124,7 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | |||
124 | /* functions */ | 124 | /* functions */ |
125 | 125 | ||
126 | #ifdef HAVE_STRERROR | 126 | #ifdef HAVE_STRERROR |
127 | extern char *strerror __P((int)); | 127 | extern char *strerror OF((int)); |
128 | # define zstrerror(errnum) strerror(errnum) | 128 | # define zstrerror(errnum) strerror(errnum) |
129 | #else | 129 | #else |
130 | # define zstrerror(errnum) "" | 130 | # define zstrerror(errnum) "" |
@@ -137,11 +137,16 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | |||
137 | # define HAVE_MEMCPY | 137 | # define HAVE_MEMCPY |
138 | #endif | 138 | #endif |
139 | #ifdef HAVE_MEMCPY | 139 | #ifdef HAVE_MEMCPY |
140 | # define zmemcpy memcpy | 140 | # ifdef M_I86MM /* MSC medium model */ |
141 | # define zmemzero(dest, len) memset(dest, 0, len) | 141 | # define zmemcpy _fmemcpy |
142 | # define zmemzero(dest, len) _fmemset(dest, 0, len) | ||
143 | # else | ||
144 | # define zmemcpy memcpy | ||
145 | # define zmemzero(dest, len) memset(dest, 0, len) | ||
146 | # endif | ||
142 | #else | 147 | #else |
143 | extern void zmemcpy __P((Byte* dest, Byte* source, uInt len)); | 148 | extern void zmemcpy OF((Byte* dest, Byte* source, uInt len)); |
144 | extern void zmemzero __P((Byte* dest, uInt len)); | 149 | extern void zmemzero OF((Byte* dest, uInt len)); |
145 | #endif | 150 | #endif |
146 | 151 | ||
147 | /* Diagnostic functions */ | 152 | /* Diagnostic functions */ |
@@ -166,12 +171,12 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | |||
166 | #endif | 171 | #endif |
167 | 172 | ||
168 | 173 | ||
169 | typedef uLong (*check_func) __P((uLong check, Byte *buf, uInt len)); | 174 | typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len)); |
170 | 175 | ||
171 | extern void z_error __P((char *m)); | 176 | extern void z_error OF((char *m)); |
172 | 177 | ||
173 | voidp zcalloc __P((voidp opaque, unsigned items, unsigned size)); | 178 | voidp zcalloc OF((voidp opaque, unsigned items, unsigned size)); |
174 | void zcfree __P((voidp opaque, voidp ptr)); | 179 | void zcfree OF((voidp opaque, voidp ptr)); |
175 | 180 | ||
176 | #define ZALLOC(strm, items, size) \ | 181 | #define ZALLOC(strm, items, size) \ |
177 | (*((strm)->zalloc))((strm)->opaque, (items), (size)) | 182 | (*((strm)->zalloc))((strm)->opaque, (items), (size)) |