cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: yangtse: curl/docs/examples 10-at-a-time.c, 1.7, 1.8 anyauthput.c, 1.6, 1.7 fopen.c, 1.11, 1.12 ftpuploadresume.c, 1.4, 1.5

From: Yang Tse <yangsita_at_gmail.com>
Date: Tue, 2 Sep 2008 01:28:23 +0200

2008/9/1, Gisle Vanem wrote:

> I wasn't talking about 'long', but 'LONG_PTR'. Look in <BaseTsd.h> in
> your SDK (all win-compilers should have this):
>
> #if defined(_WIN64)
> ..
> typedef __int64 LONG_PTR, *PLONG_PTR;
> #else
> ..
> typedef _W64 long LONG_PTR, *PLONG_PTR;
> #endif
>
> Note the '_W64' is some magic to generated appropriate warning
> when building with 'cl -Wp64'.

I can see the following...

#if defined(_WIN64)
    typedef __int64 INT_PTR, *PINT_PTR;
    [...]
    typedef __int64 LONG_PTR, *PLONG_PTR;
    [...]
#else
    typedef _W64 int INT_PTR, *PINT_PTR;
    [...]
    typedef _W64 long LONG_PTR, *PLONG_PTR;
    [...]
#endif

So I insist that for this example anyauthput.c, the only place in the
whole curl source tree where intptr_t is used, the appropriate
replacement to use is INT_PTR and not LONG_PTR. Even when long and int
happen to have the same size here they are different data types.

File descriptor data type is int for _lseek(), _read(), _fstat(),
_close() as well as the one returned from _open(). So why should we
use LONG_PTR instead of INT_PTR ?

-- 
-=[Yang]=-
Received on 2008-09-02