<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>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.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve just received a bug report and patch from someone trying to build the Perl interface with MinGW-gcc. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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 <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is the error I got<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>$ make -f win32/Makefile.gcc<o:p></o:p></p><p class=MsoNormal>gcc  -O3 -Wall -DZ_SOLO -DNO_VIZ -c -o adler32.o adler32.c<o:p></o:p></p><p class=MsoNormal>adler32.c:12:30: error: unknown type name '__int64'<o:p></o:p></p><p class=MsoNormal>adler32.c: In function 'adler32_combine_':<o:p></o:p></p><p class=MsoNormal>adler32.c:139:5: error: unknown type name '__int64'<o:p></o:p></p><p class=MsoNormal>adler32.c: In function 'adler32_combine64':<o:p></o:p></p><p class=MsoNormal>adler32.c:176:5: error: unknown type name '__int64'<o:p></o:p></p><p class=MsoNormal>make: *** [adler32.o] Error 1<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>That part seems straightforward – but he is also having problem this part of zutil.h <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#ifdef Z_SOLO<o:p></o:p></p><p class=MsoNormal>    typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */<o:p></o:p></p><p class=MsoNormal>#endif<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>His change was to make the ptrdiff_t definition conditional<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#ifdef Z_SOLO<o:p></o:p></p><p class=MsoNormal>#ifndef HAVE_PTRDIFF<o:p></o:p></p><p class=MsoNormal>    typedef long ptrdiff_t;  /* guess -- will be caught if guess is wrong */<o:p></o:p></p><p class=MsoNormal>#endif<o:p></o:p></p><p class=MsoNormal>#endif<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Where HAVE_PTRDIFF gets defined if stdint.h has been included in zconf.h (which is what the enclosed patch does).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>#if !defined(_WIN32) && (defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0)<o:p></o:p></p><p class=MsoNormal>#  define z_off64_t off64_t<o:p></o:p></p><p class=MsoNormal>#else<o:p></o:p></p><p class=MsoNormal>#  if defined(_WIN32)<o:p></o:p></p><p class=MsoNormal>#    if defined(__GNUC__)<o:p></o:p></p><p class=MsoNormal>#      include "stdint.h"<o:p></o:p></p><p class=MsoNormal>#      define HAVE_PTRDIFF<o:p></o:p></p><p class=MsoNormal>#      define z_off64_t int64_t<o:p></o:p></p><p class=MsoNormal>#    else<o:p></o:p></p><p class=MsoNormal>#      define z_off64_t __int64<o:p></o:p></p><p class=MsoNormal>#    endif<o:p></o:p></p><p class=MsoNormal>#  else<o:p></o:p></p><p class=MsoNormal>#  define z_off64_t z_off_t<o:p></o:p></p><p class=MsoNormal>#endif<o:p></o:p></p><p class=MsoNormal>#endif<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>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<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Anyone got an older MinGW install available to try it out?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Paul<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>