[Zlib-devel] zlib 1.2.3.4 Winter Solstice Edition

Vincent Torri vtorri at univ-evry.fr
Tue Dec 29 10:42:06 EST 2009



On Tue, 29 Dec 2009, Cosmin Truta wrote:

> On Tue, Dec 29, 2009 at 1:46 AM, Vincent Torri wrote:
>
>>> _WIN32_WCE must not include stddef.h, but __GNUC__ must include it.
>>> In fact, stddef.h is one of the few headers that are guaranteed to
>>> come with any installation of gcc, regardless the platform.
>>
>> you are right.
>
> Thank you, Vincent, but now I want take it back... What if another,
> non-gcc-based compiler for WinCE comes along? With this design, we
> will for ever play a cat-and-mouse game for every WinCE compiler that
> appears and doesn't suck.
>
> Let's take a good look at the line in which <stddef.h> is included
> (zutil.h:21), and then, at the line in which ptrdiff_t is defined
> (zutil.h:156). They're very fragile, and must go hand in hand
> together, otherwise the hack at line 155 doesn't work. That's because
> _PTRDIFF_T_DEFINED is defined under Visual C++, and the check will
> fail under any other non-VC++-based compiler.
>
> The right way to go is *not* by saying "if not _WIN32_WCE or __GNUC__
> or compiler X or compiler Y or..." at line 20.
> The right way to go is by saying "if not (_WIN32_WCE and _MSC_VER)".
> The fall-back definition of ptrdiff_t at line 156 will then correctly
> match this pattern.

that's a very good idea. I agree.

Now, is there a vcs for zlib ? It would be convenient to follow the 
evolution of the code.

thank you

Vincent Torri




More information about the Zlib-devel mailing list