[Zlib-devel] zlib 1.2.4.2 ready for its close up
John Bowler
jbowler at frontiernet.net
Sat Apr 10 17:07:21 EDT 2010
From: Mark Adler
>> #if defined(Z_HAVE_UNISTD_H) || _LARGEFILE64_SOURCE
>
>No one is supposed to define it. Those constructs with undefined symbols
>are supposed to work (and do work at least with my gcc), but apparently
>it doesn't always work.
Eh... this is exactly the problem we postulated might occur before; _LARGEFILE64_SOURCE *is* defined but is defined to <empty>, hence the error message:
../../zconf.h:371:52: error: operator '||' has no right operand In file included from ioapi.h:45,
>I will try to avoid those constructs, but it may get messy.
I suggest the fix you used in gzguts.h:
_LARGEFILE64_SOURCE+0
However even that depends on ANSI-C (since unary '+' is an ANSI-C feature.) The portable alternative is to add the lines to the head of zconf.h:
#ifdef _LARGEFILE64_SOURCE
#if _LARGEFILE64_SOURCE == 1
#define Z_LARGEFILE64_SOURCE 1
#endif
#endif
#ifndef Z_LARGEFILE64_SOURCE
#define Z_LARGEFILE64_SOURCE 0
#endif
And use that in both zconf.h and gzguts.h (and it matches, exactly, the semantics of the LFS stuff IRC.)
John Bowler <jbowler at acm.org>
More information about the Zlib-devel
mailing list