diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:07:35 -0700 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:07:35 -0700 |
| commit | 1c71d8b13b54f91ddec361d3053ecce26e6ff761 (patch) | |
| tree | 84f806bb79cc8c7458ddbd7b5402dbf1eec76dd4 /zutil.c | |
| parent | 64b2e892035cf6ea98800c54dce0d63730d50272 (diff) | |
| download | zlib-1c71d8b13b54f91ddec361d3053ecce26e6ff761.tar.gz zlib-1c71d8b13b54f91ddec361d3053ecce26e6ff761.tar.bz2 zlib-1c71d8b13b54f91ddec361d3053ecce26e6ff761.zip | |
zlib 0.91v0.91
Diffstat (limited to '')
| -rw-r--r-- | zutil.c | 23 |
1 files changed, 16 insertions, 7 deletions
| @@ -3,13 +3,15 @@ | |||
| 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.6 1995/04/29 14:54:02 jloup Exp $ */ | 6 | /* $Id: zutil.c,v 1.7 1995/05/02 15:54:47 jloup Exp $ */ |
| 7 | 7 | ||
| 8 | #include <stdio.h> | 8 | #include <stdio.h> |
| 9 | 9 | ||
| 10 | #include "zutil.h" | 10 | #include "zutil.h" |
| 11 | 11 | ||
| 12 | #ifndef __GO32__ | ||
| 12 | extern void exit __P((int)); | 13 | extern void exit __P((int)); |
| 14 | #endif | ||
| 13 | 15 | ||
| 14 | char *zlib_version = ZLIB_VERSION; | 16 | char *zlib_version = ZLIB_VERSION; |
| 15 | 17 | ||
| @@ -55,8 +57,9 @@ void zmemzero(dest, len) | |||
| 55 | } | 57 | } |
| 56 | #endif | 58 | #endif |
| 57 | 59 | ||
| 58 | #if defined(MSDOS) && !defined(__SMALL__) && !defined(M_I86SM) | 60 | #if defined(__TURBOC__) && !defined(__SMALL__) |
| 59 | # ifdef __TURBOC__ | 61 | |
| 62 | # define MY_ZCALLOC | ||
| 60 | 63 | ||
| 61 | /* Turbo C malloc() does not allow dynamic allocation of 64K bytes | 64 | /* Turbo C malloc() does not allow dynamic allocation of 64K bytes |
| 62 | * and farmalloc(64K) returns a pointer with an offset of 8, so we | 65 | * and farmalloc(64K) returns a pointer with an offset of 8, so we |
| @@ -124,8 +127,11 @@ void zcfree (voidp opaque, voidp ptr) | |||
| 124 | ptr = opaque; /* just to make some compilers happy */ | 127 | ptr = opaque; /* just to make some compilers happy */ |
| 125 | z_error("zcfree: ptr not found"); | 128 | z_error("zcfree: ptr not found"); |
| 126 | } | 129 | } |
| 130 | #endif /* __TURBOC__ */ | ||
| 131 | |||
| 132 | #if defined(M_I86CM) || defined(M_I86LM) /* MSC compact or large model */ | ||
| 127 | 133 | ||
| 128 | # else /* MSC */ | 134 | # define MY_ZCALLOC |
| 129 | 135 | ||
| 130 | #if (!defined(_MSC_VER) || (_MSC_VER < 600)) | 136 | #if (!defined(_MSC_VER) || (_MSC_VER < 600)) |
| 131 | # define _halloc halloc | 137 | # define _halloc halloc |
| @@ -144,12 +150,15 @@ void zcfree (voidp opaque, voidp ptr) | |||
| 144 | _hfree(ptr); | 150 | _hfree(ptr); |
| 145 | } | 151 | } |
| 146 | 152 | ||
| 147 | # endif /* __TURBOC__ ? */ | 153 | #endif /* defined(M_I86CM) || defined(M_I86LM) */ |
| 148 | 154 | ||
| 149 | #else /* !MSDOS */ | ||
| 150 | 155 | ||
| 156 | #ifndef MY_ZCALLOC /* Any system without a special alloc function */ | ||
| 157 | |||
| 158 | #ifndef __GO32__ | ||
| 151 | extern voidp calloc __P((uInt items, uInt size)); | 159 | extern voidp calloc __P((uInt items, uInt size)); |
| 152 | extern void free __P((voidp ptr)); | 160 | extern void free __P((voidp ptr)); |
| 161 | #endif | ||
| 153 | 162 | ||
| 154 | voidp zcalloc (opaque, items, size) | 163 | voidp zcalloc (opaque, items, size) |
| 155 | voidp opaque; | 164 | voidp opaque; |
| @@ -166,4 +175,4 @@ void zcfree (opaque, ptr) | |||
| 166 | free(ptr); | 175 | free(ptr); |
| 167 | } | 176 | } |
| 168 | 177 | ||
| 169 | #endif /* MSDOS */ | 178 | #endif /* MY_ZCALLOC */ |
