From 6121dc77366dbc5b7fe28e6d405e498e79630c15 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 18 Mar 2011 10:11:29 +0000 Subject: 2010-03-22 Joel Sherrill * ChangeLog.zlib, FAQ, Makefile.am, README, adler32.c, compress.c, crc32.c, deflate.c, deflate.h, infback.c, inffast.c, inflate.c, inflate.h, inftrees.c, inftrees.h, trees.c, uncompr.c, zconf.h, zlib.3, zlib.h, zutil.c, zutil.h: Update to zlib 1.2.4. * gzclose.c, gzguts.h, gzlib.c, gzread.c, gzwrite.c, doc/algorithm.txt: New files. * algorithm.txt, gzio.c: Removed. --- cpukit/zlib/zutil.h | 54 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'cpukit/zlib/zutil.h') diff --git a/cpukit/zlib/zutil.h b/cpukit/zlib/zutil.h index 4cf95f80cf..025035dbe9 100644 --- a/cpukit/zlib/zutil.h +++ b/cpukit/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2005 Jean-loup Gailly. + * Copyright (C) 1995-2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -17,26 +17,24 @@ #include "zlib.h" #ifdef STDC -# ifndef _WIN32_WCE +# if !(defined(_WIN32_WCE) && defined(_MSC_VER)) # include # endif # include # include #endif -#ifdef NO_ERRNO_H -# ifdef _WIN32_WCE - /* The Microsoft C Run-Time Library for Windows CE doesn't have - * errno. We define it as a global variable to simplify porting. - * Its value is always 0 and should not be used. We rename it to - * avoid conflict with other libraries that use the same workaround. - */ -# define errno z_errno -# endif - extern int errno; + +#if defined(UNDER_CE) && defined(NO_ERRNO_H) +# define zseterrno(ERR) SetLastError((DWORD)(ERR)) +# define zerrno() ((int)GetLastError()) #else -# ifndef _WIN32_WCE +# ifdef NO_ERRNO_H + extern int errno; +# else # include # endif +# define zseterrno(ERR) do { errno = (ERR); } while (0) +# define zerrno() errno #endif #ifndef local @@ -89,7 +87,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) # define OS_CODE 0x00 # if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) +# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) /* Allow compilation with ANSI keywords only enabled */ void _Cdecl farfree( void *block ); void *_Cdecl farmalloc( unsigned long nbytes ); @@ -118,7 +116,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #ifdef OS2 # define OS_CODE 0x06 # ifdef M_I86 - #include +# include # endif #endif @@ -151,7 +149,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # define fdopen(fd,mode) NULL /* No fdopen() */ #endif -#if (defined(_MSC_VER) && (_MSC_VER > 600)) +#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ # ifndef _PTRDIFF_T_DEFINED @@ -161,6 +159,18 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # else # define fdopen(fd,type) _fdopen(fd,type) # endif +#endif + +#if defined(__BORLANDC__) + #pragma warn -8004 + #pragma warn -8008 + #pragma warn -8066 +#endif + +#ifdef _LARGEFILE64_SOURCE +# define z_off64_t off64_t +#else +# define z_off64_t z_off_t #endif /* common defaults */ @@ -171,6 +181,12 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #ifndef F_OPEN # 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 */ @@ -197,7 +213,9 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # ifdef WIN32 /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ # if !defined(vsnprintf) && !defined(NO_vsnprintf) -# define vsnprintf _vsnprintf +# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) +# define vsnprintf _vsnprintf +# endif # endif # endif # ifdef __SASC @@ -258,7 +276,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif -voidpf zcalloc OF((voidpf opaque, uInt items, uInt size)); +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); void zcfree OF((voidpf opaque, voidpf ptr)); #define ZALLOC(strm, items, size) \ -- cgit v1.2.3