> To include the new code into FLTK I would consider the following
> things:
> 1) Import new code to 'src/scandir.c'


Yes - I guess this takes it back to being "similar" to
what it was prior to STR #2687 or so...


> 2) Change function name from 'scandir_new()' to 'fl_scandir()'
> 3) '#include "../config.h"' at the beginning so that 'HAVE_PTHREAD'
>    from autoconf becomes visible.
>    The feature test macros must stay before the first '#include'
>    of a system header file to work correctly
> 4) Ensure that 'src/scandir.c' is not build with a C++ compiler
>    (Looks like this is already the case)

Yes, the fltk Makefile ought to be doing this "right" already

> 5) List the FLTK license text in the header instead of hyperlink
> 6) Change the switching code in 'src/filename_list.cxx' like this:
> 
> ----------------------------------------------------------------------
> extern "C" {
> #ifndef HAVE_SCANDIR
>   int fl_scandir (const char *dir, dirent ***namelist,
>      int (*select)(dirent *),
>      int (*compar)(dirent **, dirent **));
> #endif
> }
> ...
> #ifndef HAVE_SCANDIR
>   // This version is when we define our own scandir
>   int n = fl_scandir(dirloc, list, 0, sort);
> ----------------------------------------------------------------------
> 
> should become something like this:
> 
> ----------------------------------------------------------------------
> extern "C" {
> #ifndef HAVE_SCANDIR
>   int fl_scandir (const char *dir, struct dirent ***namelist,
>      int (*sel)(const struct dirent *),
>      int (*compar)(const struct dirent **, const struct dirent **));
> #endif
> }
> ...
> #ifndef HAVE_SCANDIR
>   // This version is when we define our own scandir
>   int n = fl_scandir(dirloc, list, 0, (int(*)(const struct dirent **,
>                      const struct dirent **)) sort);
> ----------------------------------------------------------------------


Though we need to be cautious about not breaking
the alternate implementation of fl_scandir()
given in scandir_win32.c also.
Maybe the win32 version needs tweaked to match
the more const-correct prototype anyway?


Anyway - if you have the bits for this working, would
it be possible for you to create an STR and upload the
files there?
Just so we keep a record of all this stuff...




********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to