diff options
author | 2019-05-12 15:56:56 +0000 | |
---|---|---|
committer | 2019-05-12 15:56:56 +0000 | |
commit | f08045d97071b83f8060eb2f2b4785284b75c9c9 (patch) | |
tree | eea8fc1651fd288ca5f9d415fd39acb5ac8181a0 | |
parent | Fix signed overflow in X509_CRL_print(). (diff) | |
download | wireguard-openbsd-f08045d97071b83f8060eb2f2b4785284b75c9c9.tar.xz wireguard-openbsd-f08045d97071b83f8060eb2f2b4785284b75c9c9.zip |
Add ZLIB_CONST
Introduced in zlib-1.2.5.2, used by a few ports. ok deraadt@
-rw-r--r-- | lib/libz/zconf.h | 8 | ||||
-rw-r--r-- | lib/libz/zlib.h | 9 | ||||
-rw-r--r-- | sys/lib/libz/zconf.h | 8 | ||||
-rw-r--r-- | sys/lib/libz/zlib.h | 11 |
4 files changed, 25 insertions, 11 deletions
diff --git a/lib/libz/zconf.h b/lib/libz/zconf.h index 0bb218cd4f8..7ac5b7b8d83 100644 --- a/lib/libz/zconf.h +++ b/lib/libz/zconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zconf.h,v 1.7 2005/07/20 15:56:41 millert Exp $ */ +/* $OpenBSD: zconf.h,v 1.8 2019/05/12 15:56:56 jca Exp $ */ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h @@ -125,6 +125,12 @@ # endif #endif +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL diff --git a/lib/libz/zlib.h b/lib/libz/zlib.h index bf4ee35dedc..a2c23f08b76 100644 --- a/lib/libz/zlib.h +++ b/lib/libz/zlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zlib.h,v 1.10 2011/07/07 14:25:15 sobrado Exp $ */ +/* $OpenBSD: zlib.h,v 1.11 2019/05/12 15:56:56 jca Exp $ */ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.3, July 18th, 2005 @@ -81,7 +81,7 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ + z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ z_off_t total_in; /* total nb of input bytes read so far */ @@ -89,7 +89,7 @@ typedef struct z_stream_s { uInt avail_out; /* remaining free space at next_out */ z_off_t total_out; /* total nb of bytes output so far */ - char *msg; /* last error message, NULL if no error */ + z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ @@ -875,7 +875,8 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, match the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, diff --git a/sys/lib/libz/zconf.h b/sys/lib/libz/zconf.h index ec40afc4582..5d269e197b6 100644 --- a/sys/lib/libz/zconf.h +++ b/sys/lib/libz/zconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zconf.h,v 1.11 2011/07/07 02:57:24 deraadt Exp $ */ +/* $OpenBSD: zconf.h,v 1.12 2019/05/12 15:56:56 jca Exp $ */ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h @@ -125,6 +125,12 @@ # endif #endif +#if defined(ZLIB_CONST) && !defined(z_const) +# define z_const const +#else +# define z_const +#endif + /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL diff --git a/sys/lib/libz/zlib.h b/sys/lib/libz/zlib.h index 6d95bfa90c3..a2c23f08b76 100644 --- a/sys/lib/libz/zlib.h +++ b/sys/lib/libz/zlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zlib.h,v 1.10 2014/05/21 02:20:18 mlarkin Exp $ */ +/* $OpenBSD: zlib.h,v 1.11 2019/05/12 15:56:56 jca Exp $ */ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.3, July 18th, 2005 @@ -81,7 +81,7 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ + z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ z_off_t total_in; /* total nb of input bytes read so far */ @@ -89,7 +89,7 @@ typedef struct z_stream_s { uInt avail_out; /* remaining free space at next_out */ z_off_t total_out; /* total nb of bytes output so far */ - char *msg; /* last error message, NULL if no error */ + z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ @@ -870,12 +870,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of - the paramaters are invalid, Z_MEM_ERROR if the internal state could not + the parameters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ -typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); +typedef unsigned (*in_func) OF((void FAR *, + z_const unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, |