summaryrefslogtreecommitdiff
path: root/src/Fl_File_Icon.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-06 15:49:52 +0000
committerManolo Gouy <Manolo>2016-04-06 15:49:52 +0000
commitae0d15f1a3f133a2b2aa403c115b72819f1ac5ae (patch)
tree2e03716f4b145b75fea11fef0d0bba388c6c8712 /src/Fl_File_Icon.cxx
parentd905769e6912039a318cdccfe7cd6dc510d254d6 (diff)
Begin to rewrite files using #include <sys/stat.h> under the driver model.
struct stat is considered a platform-specific type. The Unix, Mac OS, and WIN32 platforms define it with #include <sys/stat.h> Other platforms may do that their own way. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11542 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_File_Icon.cxx')
-rw-r--r--src/Fl_File_Icon.cxx26
1 files changed, 1 insertions, 25 deletions
diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx
index a4119c922..02475bbdd 100644
--- a/src/Fl_File_Icon.cxx
+++ b/src/Fl_File_Icon.cxx
@@ -38,25 +38,12 @@
#include "flstring.h"
#include <errno.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#if (defined(WIN32) && ! defined(__CYGWIN__)) || defined(__EMX__)
-# include <io.h>
-# define F_OK 0
-#else
-# include <unistd.h>
-#endif /* WIN32 || __EMX__ */
-
+#include <FL/Fl_System_Driver.H> // for struct stat
#include <FL/Fl_File_Icon.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <FL/filename.H>
-#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - platform file browser
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: implement file type interpretation here"
-#else
-#endif
-
//
// Define missing POSIX/XPG4 macros as needed...
//
@@ -187,23 +174,13 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
int filetype) // I - Enumerated file type
{
Fl_File_Icon *current; // Current file in list
-#ifndef WIN32
struct stat fileinfo; // Information on file
-#endif // !WIN32
const char *name; // Base name of filename
// Get file information if needed...
if (filetype == ANY)
{
-#ifdef WIN32
- if (filename[strlen(filename) - 1] == '/')
- filetype = DIRECTORY;
- else if (fl_filename_isdir(filename))
- filetype = DIRECTORY;
- else
- filetype = PLAIN;
-#else
if (!fl_stat(filename, &fileinfo))
{
if (S_ISDIR(fileinfo.st_mode))
@@ -225,7 +202,6 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
}
else
filetype = PLAIN;
-#endif // WIN32
}
// Look at the base name in the filename