On 01.10.2010, at 16:48, Yuri P. Fedorchenko wrote:
> due to MS platform WIN64 have sizeof(long)!=sizeof(void)
>
> ( see http://fltk.org/str.php?L2308 )
>
> we can change long to intptr_t in callback functions
IMO we shouldn't change the interface (if that is what you
mean here).
> or write
>
> smth like this.
>
> long argument() const {return (long)(intptr_t)user_data_;}
I don't know how portable intptr_t is. Anybody?
> i have worked patch for current svn with conversions like
> (long)(intptr_t)user_data_.
>
> i can commit it. but it seems not very good to write many conversions.
Please post the patch (to STR 2308) and let us see what you have,
so that we can discuss if this finds consensus.
BTW. I've seen your postings in STR 2308, and I'm not sure that
you're not mixing up callback prototypes... You write:
void cb_smth(Fl_Widget*,long);
Fl_Menu_Item itm[]={
...
{"abra",0,(Fl_Callback*)cb_smth,1},
...
What if you write instead:
void cb_smth(Fl_Widget*,void *);
Fl_Menu_Item itm[]={
...
{"abra",0,(Fl_Callback*)cb_smth,(void *)1},
...
... and cast the void* argument in the callback back to (long) ?
That's how I would do it. Or maybe I'm missing something...
Albrecht
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev