summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-05-12 15:56:57 +0000
committerJeremie Courreges-Anglas <jca@cvs.openbsd.org>2019-05-12 15:56:57 +0000
commit594f48e7d95210421ebfe8c2fd9f4799f1bb961f (patch)
treefc612045c311478899e4a89aa0e6ee4562e27edf /lib
parent2339022305ca0848d5a91d9f293d2bde1f3fbc7a (diff)
Add ZLIB_CONST
Introduced in zlib-1.2.5.2, used by a few ports. ok deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libz/zconf.h8
-rw-r--r--lib/libz/zlib.h9
2 files changed, 12 insertions, 5 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,