[Zlib-devel] Z_SOLO & MinGW-gcc
vtorri at univ-evry.fr
vtorri at univ-evry.fr
Mon Feb 20 04:52:00 EST 2012
Quoting Paul Marquess <Paul.Marquess at ntlworld.com>:
> Let me start this with a quick bit of background - the Perl interface to
> zlib includes a sub-set of the zlib 1.2.6 sources. It doesn't use the gz
> code, so it excludes all the gz* files and uses Z_SOLO when building.
>
>
>
> I've just received a bug report and patch from someone trying to build the
> Perl interface with MinGW-gcc.
>
>
>
> Haven't used MinGW in years, so I installed it and was able to partially
> reproduce the problem by just building zlib with Z_SOLO
>
>
>
> This is the error I got
>
>
>
> $ make -f win32/Makefile.gcc
>
> gcc -O3 -Wall -DZ_SOLO -DNO_VIZ -c -o adler32.o adler32.c
>
> adler32.c:12:30: error: unknown type name '__int64'
>
> adler32.c: In function 'adler32_combine_':
>
> adler32.c:139:5: error: unknown type name '__int64'
>
> adler32.c: In function 'adler32_combine64':
>
> adler32.c:176:5: error: unknown type name '__int64'
>
> make: *** [adler32.o] Error 1
>
>
>
> Patch enclosed for that (derived from the patch I was supplied). This works
> for zlib synced from git plus 1.2.6 & 1.2.6.1
>
>
>
> That part seems straightforward - but he is also having problem this part of
> zutil.h
>
>
>
> #ifdef Z_SOLO
>
> typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
>
> #endif
>
>
>
> His change was to make the ptrdiff_t definition conditional
>
>
>
> #ifdef Z_SOLO
>
> #ifndef HAVE_PTRDIFF
>
> typedef long ptrdiff_t; /* guess -- will be caught if guess is wrong */
>
> #endif
>
> #endif
>
> Where HAVE_PTRDIFF gets defined if stdint.h has been included in zconf.h
> (which is what the enclosed patch does).
why not always using __int64 ?
Vincent Torri
>
>
>
> #if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)
>
> # define z_off64_t off64_t
>
> #else
>
> # if defined(_WIN32)
>
> # if defined(__GNUC__)
>
> # include "stdint.h"
>
> # define HAVE_PTRDIFF
>
> # define z_off64_t int64_t
>
> # else
>
> # define z_off64_t __int64
>
> # endif
>
> # else
>
> # define z_off64_t z_off_t
>
> #endif
>
> #endif
>
>
>
> Interestingly I couldn't reproduce this problem at all with zlib synced from
> git. It built fine regardless of whether the zutil.h change was applied or
> not.
>
>
>
> I presume this is a GCC version issue. The problem was reported with MinGW
> running gcc 4.4.3. I was running gcc 4.6.1
>
>
>
> Anyone got an older MinGW install available to try it out?
>
>
>
> Paul
>
>
>
>
>
>
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
More information about the Zlib-devel
mailing list