cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: int64 printf format specifier in MSVC?

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Mon, 1 Mar 2004 15:40:49 +0100

> What's the %-flag for printf() to print a int64 variable when using MSVC?
>
> I'm reverting the idea of using '%Od' for curl_off_t printf()ing, and I am
> now going for:
>
> curl_off_t size=1000;
> printf( CURL_FORMAT_OFF_T, size);
>
> ... where CURL_FORMAT_OFF_T is properly defined in curl/curl.l next to the
> code that typedefs the variable.
>
> For POSIX-systems with large file support, CURL_FORMAT_OFF_T will be %lld.

Under Windows, the print formatting is done by MSVCRT.DLL which is
used by MSVC and MingW. Watcom and Digital Mars uses their own
RTL, but they all support "%I64d". I'm not sure if "%Ld" is also supported
by all.

--gv
Received on 2004-03-01