cURL / Mailing Lists / curl-library / Single Mail


64/32/16bit curl_off_t for DJGPP and WATCOMC

From: Yang Tse <>
Date: Tue, 3 Jun 2008 13:55:25 +0200

Hi, all

I'm requesting verification/validation of the correctness of the
following snippet for DJGPP and WATCOMC compilers by those who
_actually_ have or really understand them.

The following snippet is intended to define a 64bit curl_off_t for
those configurations that are capable of the following requisites

1) Have a 64bit data type to which curl_off_t can be typedef'ed.
2) Does pointer math correctly with the above defined curl_off_t.

If for some reason the above conditions can not be satisfied then the
curl_off_t definition is intended to be a 32bit one for which similar
requisites should apply.

I'm assuming that a 32bit curl_off_t would be possible in all
configurations of this compilers. But if for some configuration/reason
it should fall back to 16bit please show us.

I understand that the 64/32/16 bit capability could also depend on
compiler version being used, so if this is the case, please, also fix
the following snippet.

#if defined(__DJGPP__)
  typedef long curl_off_t;
  #define CURL_FORMAT_OFF_T "%ld"

#elif defined(__WATCOMC__)
  #if defined(__LARGE__)
    typedef signed __int64 curl_off_t;
    #define CURL_FORMAT_OFF_T "%Ld"
    #define CURL_SIZEOF_CURL_OFF_T 8
    typedef long curl_off_t;
    #define CURL_FORMAT_OFF_T "%ld"
    #define CURL_SIZEOF_CURL_OFF_T 4


Received on 2008-06-03