summaryrefslogtreecommitdiff
path: root/zutil.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:07:35 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:07:35 -0700
commit1c71d8b13b54f91ddec361d3053ecce26e6ff761 (patch)
tree84f806bb79cc8c7458ddbd7b5402dbf1eec76dd4 /zutil.c
parent64b2e892035cf6ea98800c54dce0d63730d50272 (diff)
downloadzlib-1c71d8b13b54f91ddec361d3053ecce26e6ff761.tar.gz
zlib 0.91v0.91
Diffstat (limited to 'zutil.c')
-rw-r--r--zutil.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/zutil.c b/zutil.c
index 4ceb89f..508ad62 100644
--- a/zutil.c
+++ b/zutil.c
@@ -3,13 +3,15 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* $Id: zutil.c,v 1.6 1995/04/29 14:54:02 jloup Exp $ */
+/* $Id: zutil.c,v 1.7 1995/05/02 15:54:47 jloup Exp $ */
#include <stdio.h>
#include "zutil.h"
+#ifndef __GO32__
extern void exit __P((int));
+#endif
char *zlib_version = ZLIB_VERSION;
@@ -55,8 +57,9 @@ void zmemzero(dest, len)
}
#endif
-#if defined(MSDOS) && !defined(__SMALL__) && !defined(M_I86SM)
-# ifdef __TURBOC__
+#if defined(__TURBOC__) && !defined(__SMALL__)
+
+# define MY_ZCALLOC
/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
* and farmalloc(64K) returns a pointer with an offset of 8, so we
@@ -124,8 +127,11 @@ void zcfree (voidp opaque, voidp ptr)
ptr = opaque; /* just to make some compilers happy */
z_error("zcfree: ptr not found");
}
+#endif /* __TURBOC__ */
+
+#if defined(M_I86CM) || defined(M_I86LM) /* MSC compact or large model */
-# else /* MSC */
+# define MY_ZCALLOC
#if (!defined(_MSC_VER) || (_MSC_VER < 600))
# define _halloc halloc
@@ -144,12 +150,15 @@ void zcfree (voidp opaque, voidp ptr)
_hfree(ptr);
}
-# endif /* __TURBOC__ ? */
+#endif /* defined(M_I86CM) || defined(M_I86LM) */
-#else /* !MSDOS */
+#ifndef MY_ZCALLOC /* Any system without a special alloc function */
+
+#ifndef __GO32__
extern voidp calloc __P((uInt items, uInt size));
extern void free __P((voidp ptr));
+#endif
voidp zcalloc (opaque, items, size)
voidp opaque;
@@ -166,4 +175,4 @@ void zcfree (opaque, ptr)
free(ptr);
}
-#endif /* MSDOS */
+#endif /* MY_ZCALLOC */