curl-library
Re: curl_off_t suffix
From: Jamie Lokier <jamie_at_shareable.org>
Date: Thu, 14 Aug 2008 10:25:55 +0100
Date: Thu, 14 Aug 2008 10:25:55 +0100
Dan Fandrich wrote:
> #define INT64_C(x) (x + (INT64_MAX - INT64_MAX))
I wonder why they did that??!
If x is a large constant, how is that (123456789012345 + (INT64_MAX -
INT64_MAX)) is acceptable to the compiler (note no suffix on the
constant), but simply the constant by itself, or ((__int64_t)
123456789012345), are not?
Based on that:
> Boy, that's going to be fun to parse in m4! It may be easier to parse
> INT64_MAX instead and extract the suffix; Watcom defines that as a simple
>
> #define INT64_MAX 9223372036854775807LL
>
> but, surely, that's in itself no more portable.
I wouldn't be surprised to find some things define it as
((int64_t) 9223372036854775807) or similar.
-- Jamie
Received on 2008-08-14