Skip to content

Commit

Permalink
Add Cygwin check for scandir(); fix from Ken Yarnall.
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2595 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
michaelrsweet committed Aug 19, 2002
1 parent 614e835 commit 43519f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0

- The newest Cygwin needs the same scandir() handling as
HP-UX.
- FLUID didn't register the image formats in the
fltk_images library, and had some other image
management problems.
Expand Down
12 changes: 6 additions & 6 deletions src/filename_list.cxx
@@ -1,5 +1,5 @@
//
// "$Id: filename_list.cxx,v 1.10.2.11.2.4 2002/05/25 13:38:25 easysw Exp $"
// "$Id: filename_list.cxx,v 1.10.2.11.2.5 2002/08/19 18:11:24 easysw Exp $"
//
// Filename list routines for the Fast Light Tool Kit (FLTK).
//
Expand Down Expand Up @@ -49,8 +49,8 @@ int fl_casealphasort(struct dirent **a, struct dirent **b) {

int fl_filename_list(const char *d, dirent ***list,
Fl_File_Sort_F *sort) {
#if defined(__hpux)
// HP-UX defines the comparison function like this:
#if defined(__hpux) || defined(__CYGWIN__)
// HP-UX, Cygwin define the comparison function like this:
return scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
#elif defined(__osf__)
// OSF, DU 4.0x
Expand All @@ -59,17 +59,17 @@ int fl_filename_list(const char *d, dirent ***list,
// AIX is almost standard...
return scandir(d, list, 0, (int(*)(void*, void*))sort);
#elif HAVE_SCANDIR && !defined(__sgi)
// The vast majority of Unix systems want the sort function to have this
// 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:
return scandir(d, list, 0, (int(*)(const void*,const void*))sort);
#else
// This version is when we define our own scandir (WIN32 and perhaps
// some Unix systems) and apparently on Irix:
// some Unix systems) and apparently on IRIX:
return scandir(d, list, 0, sort);
#endif
}

//
// End of "$Id: filename_list.cxx,v 1.10.2.11.2.4 2002/05/25 13:38:25 easysw Exp $".
// End of "$Id: filename_list.cxx,v 1.10.2.11.2.5 2002/08/19 18:11:24 easysw Exp $".
//

0 comments on commit 43519f1

Please sign in to comment.