summaryrefslogtreecommitdiffstats
path: root/compat/zlib/zutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'compat/zlib/zutil.h')
-rw-r--r--compat/zlib/zutil.h54
1 files changed, 36 insertions, 18 deletions
diff --git a/compat/zlib/zutil.h b/compat/zlib/zutil.h
index fa42524..2450ae7 100644
--- a/compat/zlib/zutil.h
+++ b/compat/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
*/
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* @(#) $Id: zutil.h,v 1.1 2008/12/18 14:14:59 dkf Exp $ */
+/* @(#) $Id: zutil.h,v 1.2 2010/03/16 09:01:03 nijtmans Exp $ */
#ifndef ZUTIL_H
#define ZUTIL_H
@@ -17,26 +17,24 @@
#include "zlib.h"
#ifdef STDC
-# ifndef _WIN32_WCE
+# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
# include <stddef.h>
# endif
# include <string.h>
# include <stdlib.h>
#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 <errno.h>
# 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 <malloc.h>
+# include <malloc.h>
# 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
@@ -163,6 +161,18 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# 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 */
#ifndef OS_CODE
@@ -173,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)
@@ -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