cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: Problems with libcurl, OS X, and curl_off_t (or : What's My Size?)

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 16 Aug 2004 19:45:24 +0200 (CEST)

On Mon, 16 Aug 2004, Ryan Wilcox wrote:

> curl_off_t iSize
>
> SetOpt(CURLOPT_POSTFIELDSIZE_LARGE, (long)iSize);
> //SetOpt is a very thin wrapper over curl_easy_setopt()
>
> Having that long cast in there makes it work for me, but of course at the
> cost of being incompatible with large files. Without the cast the
> CONTENT-SIZE of the post == 0.

I blame your handicrafted config-mac.h file for this weirdness! :-) If you go
the configure-route, this is not how it'll work.

In all modern systems, curl_off_t is 8 bytes and holds 64 bits. long is 32
bits on all 32 bit computers (such as those that run Mac OS X).

Passing a long to a libcurl option that expects a curl_off_t might work, or it
might not (it basicly depends on the byte order of the platform) and vice
versa.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-08-16