aboutsummaryrefslogtreecommitdiff
path: root/zutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'zutil.c')
-rw-r--r--zutil.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/zutil.c b/zutil.c
index f32fda5..734e275 100644
--- a/zutil.c
+++ b/zutil.c
@@ -3,7 +3,7 @@
3 * For conditions of distribution and use, see copyright notice in zlib.h 3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */ 4 */
5 5
6/* $Id: zutil.c,v 1.15 1996/05/23 17:11:36 me Exp $ */ 6/* $Id: zutil.c,v 1.17 1996/07/24 13:41:12 me Exp $ */
7 7
8#include <stdio.h> 8#include <stdio.h>
9 9
@@ -28,17 +28,19 @@ const char *z_errmsg[10] = {
28""}; 28""};
29 29
30 30
31char *zlibVersion() 31const char *zlibVersion()
32{ 32{
33 return ZLIB_VERSION; 33 return ZLIB_VERSION;
34} 34}
35 35
36#ifdef DEBUG
36void z_error (m) 37void z_error (m)
37 char *m; 38 char *m;
38{ 39{
39 fprintf(stderr, "%s\n", m); 40 fprintf(stderr, "%s\n", m);
40 exit(1); 41 exit(1);
41} 42}
43#endif
42 44
43#ifndef HAVE_MEMCPY 45#ifndef HAVE_MEMCPY
44 46
@@ -53,6 +55,19 @@ void zmemcpy(dest, source, len)
53 } while (--len != 0); 55 } while (--len != 0);
54} 56}
55 57
58int zmemcmp(s1, s2, len)
59 Bytef* s1;
60 Bytef* s2;
61 uInt len;
62{
63 uInt j;
64
65 for (j = 0; j < len; j++) {
66 if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
67 }
68 return 0;
69}
70
56void zmemzero(dest, len) 71void zmemzero(dest, len)
57 Bytef* dest; 72 Bytef* dest;
58 uInt len; 73 uInt len;
@@ -138,14 +153,14 @@ void zcfree (voidpf opaque, voidpf ptr)
138 return; 153 return;
139 } 154 }
140 ptr = opaque; /* just to make some compilers happy */ 155 ptr = opaque; /* just to make some compilers happy */
141 z_error("zcfree: ptr not found"); 156 Assert(0, "zcfree: ptr not found");
142} 157}
143#endif 158#endif
144#endif /* __TURBOC__ */ 159#endif /* __TURBOC__ */
145 160
146 161
147#if defined(M_I86) && !(defined(__WATCOMC__) && defined(__386__)) 162#if defined(M_I86) && !defined(__32BIT__)
148/* Microsoft C */ 163/* Microsoft C in 16-bit mode */
149 164
150# define MY_ZCALLOC 165# define MY_ZCALLOC
151 166