1 Sep 2008 02:05
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
Yang Tse <yangsita <at> gmail.com>
2008-09-01 00:05:24 GMT
2008-09-01 00:05:24 GMT
2008/8/31, Gisle Vanem wrote: > > --- anyauthput.c 22 May 2008 21:20:08 -0000 1.6 > > +++ anyauthput.c 31 Aug 2008 12:12:35 -0000 1.7 > > > ... > > +#ifdef _MSC_VER > > +# ifdef _WIN64 > > + typedef __int64 intptr_t; > > +# else > > + typedef int intptr_t; > > +# endif > > +#endif > > > > How about using 'LONG_PTR'? I should have the correct size on > Win32/Win64. Hmmm. I didn't inspect enough the source of that example. It failed to compile with MSVC due to the lack of 'intptr_t', and I simply provided a valid definition of it for MSVC. But, as you have noticed intptr_t is being used in that example assuming size characteristics of that data type that actually it doesn't have. As you point out, it could simply use (long *) or maybe even better just (void *) -- --(Continue reading)
What was committed to CVS is appropriate 'as is', no need to change
anything. What rules here is the sizeof(void *) which under _WIN64 is
8 and under _WIN32 is 4. So, the introduced change for MSVC is
appropriate for both _WIN64 and _WIN32, and allows compilation under
MSVC without an intptr_t.
If the example should be using in some points a pointer to FILE
instead of a pointer to file descriptor and later using fileno() is
something I don't know. It much depends on the intention of example
author.
RSS Feed