[Zlib-devel] zlib 1.2.4.2 ready for its close up

John Bowler jbowler at frontiernet.net
Sat Apr 10 18:01:22 EDT 2010


From: Mark Adler
>Wouldn't unary minus be allowed as a minus sign?  I.e. is -0 a valid number?

Yes, that's portable (i.e. it was in K&R, unlike +0).

>> The portable alternative is to add the lines to the head of zconf.h:
>> 
>> #ifdef _LARGEFILE64_SOURCE
>> #if _LARGEFILE64_SOURCE == 1
>
>That results in the same error if _LARGEFILE64_SOURCE was defined but empty.

You are correct, I had totally forgotten that #if lines are always parsed.  As you say, it gets messy.  The following should work:

#ifdef _LARGEFILE64_SOURCE
#if _LARGEFILE64_SOURCE-0 == 1
#define Z_LARGEFILE64_SOURCE 1
#endif
#endif
#ifndef Z_LARGEFILE64_SOURCE
#define Z_LARGEFILE64_SOURCE 0
#endif

I tested it this time (with -D_LARGEFILE64_SOURCE, -D_LARGEFILE64_SOURCE= and with no definition.)

John Bowler <jbowler at acm.org>






More information about the Zlib-devel mailing list