On Wed, 03 Apr 2013 09:34:22 -0700, Greg Ercolano <e...@seriss.com>
wrote:

>> I notice that old examples used
>> int i = (int)v;
>> but that won't work with gcc-4.4.5
>
>       Right -- probably a "precision loss" error during the void* -> int,
>       since sizeof(void*)==8 and sizeof(int)==4.
>
>       I think the best approach (in 1.3.x) is to use the new fl_intptr_t, e.g.
>
>           int i = fl_intptr_t(v);
>
>       Or, you could just use a long instead of an int, but that might cause
>       trouble on non-64bit builds.. which is I think what fl_intptr_t tries
>       to solve. (See the definition in FL/Fl_Widget.H)


When I first compiled with 64 bit linux the compiler complained about 

 int i = (int)(v);


but was happy with 

long i = (long)(v);

Both Linux and mingw 32 bit are happy with the change to long from
int.

Mingw64 is another fish. AFAIK pointers in win64 are 64 bit pointers
and the compiler issues errors. The work around for that is to use the
compiler switch "fpermissive", then only warnings are issued.

Now in all cases long works so the same code covers all bets. Don't
know about macs though.
Cheers Richard
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to