From aafd8b6031e66e0b2f727197c1d1d040036ec0a8 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 11 Apr 2016 00:46:11 +0000 Subject: Fix VisualC++ build (Visual Studio 2015). IDE generated with CMake, still many warnings, but compiles and runs. Note: we *must* get rid of all VisualStudio-specific #define's like: #define unlink _unlink This one led to a compilation error (not a warning). src/Fl_File_Icon.cxx: I had to add _MSC_VER (WIN32) distinction as in previous code (FLTK 1.3). Obviously MinGW is more Unixy than MS VC++ since MinGW compiled and linked the code. Needs a better fix ... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_File_Icon.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Fl_File_Icon.cxx') diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx index 02475bbdd..2d6448943 100644 --- a/src/Fl_File_Icon.cxx +++ b/src/Fl_File_Icon.cxx @@ -174,13 +174,21 @@ 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 - struct stat fileinfo; // Information on file const char *name; // Base name of filename // Get file information if needed... if (filetype == ANY) { +#ifdef _MSC_VER // was: WIN32 + if (filename[strlen(filename) - 1] == '/') + filetype = DIRECTORY; + else if (fl_filename_isdir(filename)) + filetype = DIRECTORY; + else + filetype = PLAIN; +#else + struct stat fileinfo; // Information on file if (!fl_stat(filename, &fileinfo)) { if (S_ISDIR(fileinfo.st_mode)) @@ -202,6 +210,7 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */ } else filetype = PLAIN; +#endif // _MSC_VER // was: WIN32 } // Look at the base name in the filename -- cgit v1.2.3