[Zlib-devel] [PATCH] Avoid inclusion of unistd.h in all source files
Xin LI
delphij at gmail.com
Mon Mar 29 16:22:17 EDT 2010
Hi, Mark,
On Sat, Mar 27, 2010 at 10:00 PM, Mark Adler <madler at alumni.caltech.edu> wrote:
> On Mar 18, 2010, at 2:34 PM, Xin LI wrote:
>> 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).
>
> The users of gzseek() need SEEK_*, so those need to be defined somehow by the inclusion of zlib.h/zconf.h. For systems with unistd.h, that is best done by including unistd.h.
Oh okay that makes sense.
Could we do this instead, perhaps, when _STANDALONE (means
freestanding environment, e.g. boot loader where unistd.h needs to be
avoided) is defined, don't include unistd.h?
Thanks in advance!
Cheers,
--
Xin LI <delphij at delphij.net> http://www.delphij.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zlib_standalone.diff
Type: application/octet-stream
Size: 877 bytes
Desc: not available
URL: <http://madler.net/pipermail/zlib-devel_madler.net/attachments/20100329/fe6edf39/attachment-0001.obj>
More information about the Zlib-devel
mailing list