[Zlib-devel] Allow read-only data as input

glennrp at comcast.net glennrp at comcast.net
Mon Mar 28 23:33:43 EDT 2011


----- Original Message -----
From: Mike Frysinger <vapier at gentoo.org>
To: zlib-devel at madler.net
Sent: Tue, 29 Mar 2011 02:57:16 -0000 (UTC)
Subject: Re: [Zlib-devel] Allow read-only data as input

On Mon, Mar 28, 2011 at 9:52 PM, Jonathan Nieder wrote:
> Mike Frysinger wrote:
>> Mark Adler wrote:
>>> What if we added a ZLIB_CONST #define that, if defined, would add the
>>> const's in zlib.h where appropriate?
>
> Sounds excellent to me, for what it's worth.

>
>> what if we negated the logic so that people would get const by default
>> ?  so people could define ZLIB_NO_CONST to avoid transitional logic.
>
> That would needlessly cause existing programs that "free(s.next_in);"
> to break without warning.

put it into NEWS and then people are warned
-mike

-------------------------
Been using it in libpng (PNG_CONST) for a long time.  It's "const"
by default and "" if the builder passes PNG_NO_CONST.

Somewhere in pngconf.h we have

#ifndef PNG_CONST
#  ifndef PNG_NO_CONST
#    define PNG_CONST const
#  else
#    define PNG_CONST
#  endif
#endif  




More information about the Zlib-devel mailing list