2009/10/18 Igor Skochinsky <skochin...@mail.ru>

> Actually, in VC9 it returns intptr_t (MSDN is wrong here):
>
> _CRTIMP intptr_t __cdecl _get_osfhandle(_In_ int _FileHandle);
> (from io.h)
>
> So it might be worth it to get mingw people to fix their headers...
>

Actually, the io.h from MinGW-W64 does have the same declaration as VC9.
Looks like most people, including the original coder and myself, thought
MSDN was providing accurate data.
I now see that now there's a comment on that page that warns 64 bit
programmers as well...

>From my testing, it looks like using an intptr_t rather than a long works on
both cygwin and mingw-w64, despite the fact that cygwin still uses "extern
long get_osfhandle(int);" in their io.h
I guess this won't matter to them till they go 64 bit, which doesn't look
likely for now.

2009/10/18 David Brownell <davi...@pacbell.net>

> Linux solves that by casting first to intptr_t:
>
> Could you send me a patch you've verified works, using that approach?
>

No sooner said than done. Tested on both mingw-w64 and cygwin-w32 -> no
warnings.
I preferred doing away with the long altogether, rather than use the double
cast.

Attachment: patch_long_to_handler_mingw_w64_v2.diff
Description: Binary data

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to