On 12 Aug 2012, at 15:50, Greg Ercolano wrote:

>       Function pointers are syntactically messy, but basically what has
>       to happen here is you need to recast the func pointer from the former
>       to the latter.
> 
>       The FLTK line in question currently reads:
> 
> return scandir(d, list, 0, (int(*)(const void*,const void*))numericsort);
>                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
>       The underlined bit is the problem, and is itself trying to
>       re-cast the function pointer 'numericsort' from whatever it is
>       to be a function that takes two const void*'s, but what the
>       compiler /wants/ to see is two const dirent **'s.
> 
>       So I think if you just change the two instances of "const void*"
>       in that line to const dirent**'s, that should fix it, I'd think.

Though if you really want to see this in all its messy glory, look at the file 
filename_list.cxx in the 1.3 tarball and see how it deals with all the 
different versions of scandir() that we actually encounter out in the wild...

Really, if you are patching 1.0 to work "everywhere" you would need something 
similar to that anyway!





_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to