diff options
Diffstat (limited to 'lib/libz/zutil.h')
-rw-r--r-- | lib/libz/zutil.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/libz/zutil.h b/lib/libz/zutil.h index eb850276fd6..c03e065da1e 100644 --- a/lib/libz/zutil.h +++ b/lib/libz/zutil.h @@ -1,7 +1,7 @@ -/* $OpenBSD: zutil.h,v 1.11 2021/07/04 17:41:23 tb Exp $ */ +/* $OpenBSD: zutil.h,v 1.12 2022/05/08 14:04:22 tb Exp $ */ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler + * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -33,10 +33,6 @@ #endif #endif -#ifdef Z_SOLO - typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */ -#endif - #ifndef local # define local static #endif @@ -50,6 +46,17 @@ typedef unsigned short ush; typedef ush FAR ushf; typedef unsigned long ulg; +#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC) +# include <limits.h> +# if (ULONG_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned long +# elif (ULLONG_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned long long +# elif (UINT_MAX == 0xffffffffffffffff) +# define Z_U8 unsigned +# endif +#endif + extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* (size given to avoid silly warnings with Visual C++) */ @@ -174,10 +181,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX # if defined(_WIN32_WCE) # define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif # else # define fdopen(fd,type) _fdopen(fd,type) # endif |