cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: LONG_MAX patch

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 21 Jan 2004 09:17:34 +0100 (CET)

On Mon, 19 Jan 2004, Gisle Vanem wrote:

> I don't understand all the issues with filesizes in libcurl, but.. AFAICS,
> tell them to use an 'unsigned __int64' (MSVC/Watcom) or 'unsigned long long'
> (GNU C) in the argument to CURLOPT_RESUME_FROM_LARGE,
> CURLOPT_MAXFILESIZE_LARGE etc. If they use CURLOPT_RESUME_FROM and truncate
> a file, that's just bad luck.

I think I'm now in favour of adding magic similar to this in an external
public curl header file:

#if defined(_MSC_VER) || defined(__WATCOMC__)
/* MSVC and Watcom compilers */
typedef signed __int64 curl_off_t;
#else
#if defined(__GNUC__) && defined(WIN32)
/* gcc on windows */
typedef long long curl_off_t;
#else
/* "normal" approach */
typedef off_t curl_off_t;
#endif
#endif

... and then we document that type (curl_off_t) for _LARGE options, and we use
that internally all over where we currently use off_t.

Anyone with comments, objections or anything?

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-01-21