[Zlib-devel] zlib 1.2.4 released!

William A. Rowe Jr. wrowe at rowe-clan.net
Thu Mar 18 04:57:52 EDT 2010


On 3/17/2010 10:15 PM, William A. Rowe Jr. wrote:
> On 3/17/2010 8:28 PM, Hiroshi Kuno wrote:
>> I think that gzdopen() should be removed from DLL. gzdopen() can be used only with static-lib.
> 
> I'm actually pondering implementing gzdopen() as a crt agnotisic macro wrapper, where
> it would ultimate pass that binary's HFILE to the underlying library.

It might look something like;

  ZEXTERN gzFile ZEXPORT gzwhopen OF((HANDLE file, const char *mode));

  #define gzdopen(fd, mode) gzwhopen((HANDLE)_get_osfhandle(fd), mode)

for most typical cases.  Of course gzdopen needs to be exported for a fair
amount of time, at least as long as 1.2.x, but for a casual user this would
avoid penalizing them for any mismatch of CRTs.

There is the issue that CRT's fd buffering wouldn't correspond to the raw
handle's buffering.  That is a serious problem that needs more consideration.





More information about the Zlib-devel mailing list