[Zlib-devel] zlib 1.2.6.1
jbowler at acm.org
jbowler at acm.org
Mon Feb 13 18:06:10 EST 2012
The new byteswap macros also break Z_SOLO on Windows 64-bit Visual Studio, because they cause the include (eventually) of 'crtdefs.h' which defines ptrdiff_t.
As discussed before, this might be a bug in Visual Studio - the only #include I can see is <stdlib.h> and it shouldn't be defining ptrdiff_t.
Nevertheless stdlib.h is a library header, so not necessarily present in a free-standing environment, and Z_SOLO should probably, therefore, disable the byteswap includes (both the VS <stdlib.h> include and the GCC <byteswap.h> include.) Alternatively you could give in and just include <stddef.h> even when Z_SOLO is defined to get ptrdiff_t and size_t; after all every C89 and later C compiler provides stddef.h (even freestanding ones) and the types it defines are pretty fundamental to sane C programming.
John Bowler <jbowler at acm.org>
-----Original Message-----
From: zlib-devel-bounces at madler.net [mailto:zlib-devel-bounces at madler.net] On Behalf Of Maarten Bosmans
Sent: Monday, February 13, 2012 1:46 PM
To: zlib-devel at zlib.net
Subject: Re: [Zlib-devel] zlib 1.2.6.1
2012/2/13 Mark Adler <madler at madler.net>:
> Bosmans - Cross compiling from Linux for both win32 and win64 using
> gcc/mingw
Tested it and found the following two issues (patches attached)
- gzget_ should also be removed from win32/zlib.def
- The function __builtin_bswap32 is not defined in byteswap.h, but is a GCC intrinsic
byteswap.h does define a bswap_32 function, which could be used in another #elif branch, but the current patch does not provide for that.
Maarten
More information about the Zlib-devel
mailing list