[Zlib-devel] zlib version 1.2.3.8 available for testing

Vincent Torri vtorri at univ-evry.fr
Mon Feb 15 02:30:34 EST 2010



On Mon, 15 Feb 2010, Philip Lowman wrote:

> On Mon, Feb 15, 2010 at 1:43 AM, Mark Adler <madler at alumni.caltech.edu> wrote:
>> On Feb 14, 2010, at 8:33 PM, Philip Lowman wrote:
>>> The build fails on MSVC due to snprintf() usage.  Here's a patch.
>>
>> Philip,
>>
>> Thanks for the report.  There is something wrong here.  STDC should be defined, and so configure should try to use vsnprintf(), not snprintf().  MSVC has that function, so that should succeed, and the build should work using vsnprintf().  Can you check to see why that isn't happening?
>
> MSVC apparantly has vsnprintf() but not snprintf().  Since the code is

windows defines _snprintf :

http://msdn.microsoft.com/en-us/library/2ts7cx93%28VS.71%29.aspx

possible patch:

#ifdef _MSC_VER
# define snprintf _snprintf
#endif

at the top of the file where snprintf is used (so that the code of the 
function is not modified)

Vincent Torri

> calling snprintf() explicitly that's why it's failing.  No other
> source file in zlib has yet called snprintf() except for those that
> are not STDC.
>
> Instead of my patch, I suppose you could modify gzlib.c to call
> vsnprintf instead.  That's probably better actually.  Forgive me, I
> don't use C that often... don't think I've ever used vsnprintf in my
> life. :)
>
> -- 
> Philip Lowman
>
> _______________________________________________
> Zlib-devel mailing list
> Zlib-devel at madler.net
> http://mail.madler.net/mailman/listinfo/zlib-devel_madler.net
>
>


More information about the Zlib-devel mailing list