cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Helping apps use 64bit with libcurl

From: Jamie Lokier <jamie_at_shareable.org>
Date: Wed, 21 May 2008 16:40:27 +0100

Daniel Stenberg wrote:
> >Suggestion: let the *_LARGE constants have different values at compile
> >time, determined by the header file, according to the size of curl_off_t.
> >
> >Programs compiled with one size, and linked to a library compiled with a
> >different size, will give sensible error results due to the mismatched
> >constants, instead of random failues or even spurious successes.
>
> I like this idea, but it won't be perfect unless we also make the header
> file contain information about how the lib was built.

I don't see this. The header would define constants which depend
_only_ on the size of curl_off_t when the header is included. Since
the header also defines curl_off_t, what's the problem?

> I mean, even on
> modern systems where we normally build libcurl with 64bit sizes people can
> in fact enforce 32bit builds and I think it would be a bit lacking to just
> assume 64bit ability because it should be enabled not because it actually
> was enabled.

But if they are using a 32bit library build, they are using a 32bit
curl_off_t aren't they? The header they're including knows this.

(Even if it's not available to the preprocessor, you can define enum
constants in terms of sizeof(curl_off_t) if necessary.)

-- Jamie
Received on 2008-05-21