summaryrefslogtreecommitdiff
path: root/src/scandir.c
diff options
context:
space:
mode:
authorIan MacArthur <imacarthur@gmail.com>2013-03-06 22:15:01 +0000
committerIan MacArthur <imacarthur@gmail.com>2013-03-06 22:15:01 +0000
commit8e789d61a3da520643898dbb0829419401355e97 (patch)
treed7da2f4b87dfefcb908aec9fc5eee5064ec0641b /src/scandir.c
parent3de79d1fd0faa283928a3a4b53353dde53ae3a43 (diff)
This check-in brings in the simplified version of
Michael Baeuerle's patch to restore scandir like operation on *nix like hosts that do not provide a native scandir implementation, notably SunOS and some others. STR #2931 refers... These changes are tested to have no effect on OSX, Win32 or Linux systems, and indeed on any system that has a working scandir implementation that configure can detect. Michael has released these changes to the fltk project, and they are licensed under our usual conditons. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9832 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/scandir.c')
-rw-r--r--src/scandir.c38
1 files changed, 4 insertions, 34 deletions
diff --git a/src/scandir.c b/src/scandir.c
index ab2a50d3f..2cfbce27e 100644
--- a/src/scandir.c
+++ b/src/scandir.c
@@ -21,40 +21,10 @@
#if defined(WIN32) && !defined(__CYGWIN__)
# include "scandir_win32.c"
#else
-
-# include "flstring.h"
-
-/* NOTE: Most (all?) modern non-WIN32 hosts DO have a usable scandir */
-# if !HAVE_SCANDIR
-# include <stdlib.h>
-# include <sys/types.h>
-# include <errno.h>
-
-# if HAVE_DIRENT_H
-# include <dirent.h>
-# define NAMLEN(dirent) strlen((dirent)->d_name)
-# else /* HAVE_DIRENT_H */
-# define dirent direct
-# define NAMLEN(dirent) (dirent)->d_namlen
-# if HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif /* HAVE_SYS_NDIR_H */
-# if HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif /* HAVE_SYS_DIR_H */
-# if HAVE_NDIR_H
-# include <ndir.h>
-# endif /* HAVE_NDIR_H */
-# endif
-
-/* This warning added to help identify any non-WIN32 hosts that actually try to use
- * our "private" implementation of the scandir function, which was suspect... */
-# if defined(__GNUC__)
-# warning Attempting to use the deprecated scandir() replacement function
-# endif /*__GNUC__*/
-# error No compatible scandir implementation found (STR 2687 applies!)
-
-# endif /* !HAVE_SCANDIR */
+# include "../config.h"
+# ifndef HAVE_SCANDIR
+# include "scandir_posix.c"
+# endif /* HAVE_SCANDIR */
#endif
/*