cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Helping apps use 64bit with libcurl

From: Michal Marek <mmarek_at_suse.cz>
Date: Wed, 21 May 2008 18:35:38 +0200

Jamie Lokier wrote:
> 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?

Interesting idea. I think something this would allow the library to "do
the right thing" without even having to spit errors:

typedef enum {
...
CURLOPT_POSTFIELDSIZE_LARGE = (
  sizeof(curl_off_t) < 8 ?
   CURLOPT_POSTFIELDSIZE :
   CURLOPTTYPE_OFF_T + 120)
...
} CURLoption;

In English: if building without LFS, make CURLOPT_POSTFIELDSIZE_LARGE
equivalent to CURLOPT_POSTFIELDSIZE.

Michal
Received on 2008-05-21