Skip to content
Snippets Groups Projects
Commit f4e31758 authored by Sébastien Dinot's avatar Sébastien Dinot
Browse files

BUG: scandir() prototype variation according to the GNU libc version taken into account

parent a0e64a75
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,13 @@ int fl_filename_list(const char *d, dirent ***list,
// The vast majority of UNIX systems want the sort function to have this
// prototype, most likely so that it can be passed to qsort without any
// changes:
int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
#if ( defined(__GLIBC__) && __GLIBC_PREREQ(2, 10) )
int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
#else
int n = scandir(d, list, 0, (int(*)(const void*, const void*))sort);
#endif /* ( defined(__GLIBC__) && __GLIBC_PREREQ(2, 10) ) */
#else
// This version is when we define our own scandir (WIN32 and perhaps
// some Unix systems) and apparently on IRIX:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment