[Zlib-devel] [PATCH] Avoid inclusion of unistd.h in all source files

Xin LI delphij at gmail.com
Thu Mar 18 17:34:32 EDT 2010


Hi,

It seems that zconf.h would include unistd.h if HAVE_UNISTD_H is set.
However, only the gzlib.c, gzread.c and gzwrite.c really needs that
(gzlib.c needs SEEK_* while the others needs standard Unix system
calls).

I have put together a patchset to push down these inclusion to only
the affected .c files.

Another side effect of having zconf.h to include unistd.h is that it
would cause namespace pollution in a freestanding compile, causing it
difficult to share a same copy of zlib source code by utilizing patch
technique.

Cheers,
-- 
Xin LI <delphij at delphij.net> http://www.delphij.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib-unistd.diff
Type: application/octet-stream
Size: 3785 bytes
Desc: not available
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20100318/2fed2708/attachment.obj>


More information about the Zlib-devel mailing list