diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-10-18 23:05:37 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-10-18 23:05:37 -0700 |
commit | 5ab9f47745fe9353291b217f705086b6070575d5 (patch) | |
tree | 0a6c69f912f56cdbd36328cc67e4637bde6208b9 /zconf.h | |
parent | 5b48d061c8c46bc19e6ad965157440880e5708b9 (diff) | |
download | zlib-5ab9f47745fe9353291b217f705086b6070575d5.tar.gz zlib-5ab9f47745fe9353291b217f705086b6070575d5.tar.bz2 zlib-5ab9f47745fe9353291b217f705086b6070575d5.zip |
Add #define ZLIB_CONST option to use const in the z_stream interface.
This permits compilers to check for the proper treatment of next_in and
msg in the z_stream structure. This is an option instead of the default
in order to preserve backward compatibility. Some applications make use
of the z_stream structure outside of zlib, and perform operations such
as free(strm->next_in), which would not be permitted when next_in is
const. The #define ZLIB_CONST needs to precede the #include "zlib.h">,
in order to make next_in and msg const pointers in the z_stream type.
Diffstat (limited to 'zconf.h')
-rw-r--r-- | zconf.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -214,6 +214,12 @@ | |||
214 | # endif | 214 | # endif |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | #if defined(ZLIB_CONST) && !defined(z_const) | ||
218 | # define z_const const | ||
219 | #else | ||
220 | # define z_const | ||
221 | #endif | ||
222 | |||
217 | /* Some Mac compilers merge all .h files incorrectly: */ | 223 | /* Some Mac compilers merge all .h files incorrectly: */ |
218 | #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) | 224 | #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) |
219 | # define NO_DUMMY_DECL | 225 | # define NO_DUMMY_DECL |