[Zlib-devel] [PATCH] Check on _LARGEFILE64_SOURCE and friends are too strict

Xin LI delphij at gmail.com
Thu Apr 1 17:26:06 EDT 2010


On Thu, Apr 1, 2010 at 2:19 PM, Mark Adler <madler at alumni.caltech.edu> wrote:
> On Apr 1, 2010, at 2:11 PM, Xin LI wrote:
>> Is there any standard requiring _LARGEFILE64_SOURCE to be defined as a number?
>
> Yes.  This is the LFS document:
>
>    http://www.unix.org/version2/whatsnew/lfs20mar.html
>
> which states that it has to be defined as 1.  However in the same document, they give an example where it is just defined and not set to 1.  Also since GNU only looks for it to be defined, I will update zlib accordingly.

I think Google have turned out a lot of different examples without
defining as 1.  Will disabling it through defining it as 0 work?

>
> Maybe something like defined(_LARGEFILE64_SOURCE) && _LARGEFILE64_SOURCE != 0 .

This won't work on GCC 4.2 at least.  I got the following error if
_LARGEFILE64_SOURCE defined as empty:

test.c:5:35: error: operator '&&' has no right operand

Cheers,
-- 
Xin LI <delphij at delphij.net> http://www.delphij.net




More information about the Zlib-devel mailing list