Duncan,
Sorry, I couldn't get back to you sooner - had a real emergency at work.
My Linux distribution is Gentoo Linux. I've check that scandir is declared
in dirent.h. The scandir/scandir64 functions have the following declaration
there:
extern int scandir (__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const struct dirent **,
__const struct dirent **))
__nonnull ((1, 2));
The dirent.h file belongs to glibc. My glibc version is 2.10.1, the latest.
IMHO, the scandir function declaration has changed in new glibc. The
glibc-2.5 used in RHEL-5.2, however, declares that function as:
extern int scandir (__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const void *, __const void *))
__nonnull ((1, 2));
So, in order to make it compile we gotta distinguish the GLIBC versions.
2009/6/11 Duncan Gibson <[email protected]>
>
> DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK
> BELOW.
>
> [STR New]
>
> Link: http://www.fltk.org/str.php?L2202
> Version: 2.0-current
>
>
> For info (because I'm no 32-bit/64-bit system guru)
>
> From what I can see, both fltk-1.1.9 and fltk-1.3.x have already
> been updated (or rather, the filename_list.cxx code doesn't match
> what appears in the patch above).
>
> I just checked out the FLTK-2.0 sources, and on my 32-bit Linux
> system, with gcc-4.2.4, the vanilla sources built OK, but if I
> apply your changes, I get the following error:
>
> dun...@wired ~/src/fltk-2.0.x/fltk $ make
> === making src ===
> Compiling filename_list.cxx...
> filename_list.cxx: In function 'int fltk::filename_list(const char*,
> dirent64***, int (*)(const dirent64* const*, const dirent64* const*))':
> filename_list.cxx:68: error: invalid conversion from 'int (*)(const
> dirent64**, const dirent64**)' to 'int (*)(const void*, const void*)'
> filename_list.cxx:68: error: initializing argument 4 of 'int
> scandir64(const char*, dirent64***, int (*)(const dirent64*), int
> (*)(const void*, const void*))'
> make[1]: *** [filename_list.o] Error 1
> make: *** [all] Error 2
>
> I get a similar (same?) message if I keep the vanilla source, but
> change HAVE_SCANDIR to 0 in config.h
>
>
> dun...@wired ~/src/fltk-2.0.x/fltk $ g++ -v
> Using built-in specs.
> Target: i686-pc-linux-gnu
> Configured with: ../configure --host=i686-pc-linux-gnu
> --enable-languages=c++ --prefix=/usr --infodir=/usr/share/info
> --mandir=/usr/share/man --enable-__cxa_atexit --enable-threads
> --disable-nls --enable-target-optspace --with-gnu-ld --with-system-zlib
> --enable-shared
> Thread model: posix
> gcc version 4.2.4
>
>
> Link: http://www.fltk.org/str.php?L2202
> Version: 2.0-current
>
>
--
Alexey Parshin,
http://www.sptk.net
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs