diff options
Diffstat (limited to 'cpukit/zlib/zutil.h')
-rw-r--r-- | cpukit/zlib/zutil.h | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/cpukit/zlib/zutil.h b/cpukit/zlib/zutil.h index 258fa88799..279a048804 100644 --- a/cpukit/zlib/zutil.h +++ b/cpukit/zlib/zutil.h @@ -13,12 +13,7 @@ #ifndef ZUTIL_H #define ZUTIL_H -#if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) -# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) -#else -# define ZLIB_INTERNAL -#endif - +#define ZLIB_INTERNAL #include "zlib.h" #ifdef STDC @@ -29,6 +24,19 @@ # include <stdlib.h> #endif +#if defined(UNDER_CE) && defined(NO_ERRNO_H) +# define zseterrno(ERR) SetLastError((DWORD)(ERR)) +# define zerrno() ((int)GetLastError()) +#else +# ifdef NO_ERRNO_H + extern int errno; +# else +# include <errno.h> +# endif +# define zseterrno(ERR) do { errno = (ERR); } while (0) +# define zerrno() errno +#endif + #ifndef local # define local static #endif @@ -159,10 +167,10 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #pragma warn -8066 #endif -/* provide prototypes for these when building zlib without LFS */ -#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 - ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); - ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); +#ifdef _LARGEFILE64_SOURCE +# define z_off64_t off64_t +#else +# define z_off64_t z_off_t #endif /* common defaults */ @@ -175,6 +183,12 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define F_OPEN(name, mode) fopen((name), (mode)) #endif +#ifdef _LARGEFILE64_SOURCE +# define F_OPEN64(name, mode) fopen64((name), (mode)) +#else +# define F_OPEN64(name, mode) fopen((name), (mode)) +#endif + /* functions */ #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) @@ -236,16 +250,16 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define zmemzero(dest, len) memset(dest, 0, len) # endif #else - void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); + extern void zmemzero OF((Bytef* dest, uInt len)); #endif /* Diagnostic functions */ #ifdef DEBUG # include <stdio.h> - extern int ZLIB_INTERNAL z_verbose; - extern void ZLIB_INTERNAL z_error OF((char *m)); + extern int z_verbose; + extern void z_error OF((char *m)); # define Assert(cond,msg) {if(!(cond)) z_error(msg);} # define Trace(x) {if (z_verbose>=0) fprintf x ;} # define Tracev(x) {if (z_verbose>0) fprintf x ;} @@ -262,9 +276,8 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif -voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, - unsigned size)); -void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); +voidpf zcalloc OF((voidpf opaque, uInt items, uInt size)); +void zcfree OF((voidpf opaque, voidpf ptr)); #define ZALLOC(strm, items, size) \ (*((strm)->zalloc))((strm)->opaque, (items), (size)) |