[Zlib-devel] [PATCH] use "zalloc_func" and "zfree_func" instead of "alloc_func" and "free_func"

Mark Adler madler at alumni.caltech.edu
Fri Feb 6 09:47:13 EST 2004


On Friday, February 6, 2004, at 12:09 AM, lepton wrote:
> 	when I compile a program use zlib and openssl,I found if I
> 	include zlib.h first,I will get compile errors like this:

The solution is, as you imply, to include zlib.h last.

> 	I found the reason is that zlib has typedef "free_func" and 
> "alloc_func".
> I think such name is not a good choice for a libarary, I think we'd
> better change it to something like "zfree_func" and "zalloc_func".

You are entirely correct.  That was a poor choice of names.  However 
zlib is stuck with those names to maintain backward compatibility.

mark





More information about the Zlib-devel mailing list