mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 15:46:52 +08:00
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
This commit is contained in:
@@ -61,6 +61,7 @@
|
|||||||
# define access _access
|
# define access _access
|
||||||
# define chdir _chdir
|
# define chdir _chdir
|
||||||
# define getcwd _getcwd
|
# define getcwd _getcwd
|
||||||
|
# define unlink _unlink
|
||||||
# endif // !__WATCOMC__
|
# endif // !__WATCOMC__
|
||||||
#else
|
#else
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
|
|||||||
+10
-1
@@ -174,13 +174,21 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
|
|||||||
int filetype) // I - Enumerated file type
|
int filetype) // I - Enumerated file type
|
||||||
{
|
{
|
||||||
Fl_File_Icon *current; // Current file in list
|
Fl_File_Icon *current; // Current file in list
|
||||||
struct stat fileinfo; // Information on file
|
|
||||||
const char *name; // Base name of filename
|
const char *name; // Base name of filename
|
||||||
|
|
||||||
|
|
||||||
// Get file information if needed...
|
// Get file information if needed...
|
||||||
if (filetype == ANY)
|
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 (!fl_stat(filename, &fileinfo))
|
||||||
{
|
{
|
||||||
if (S_ISDIR(fileinfo.st_mode))
|
if (S_ISDIR(fileinfo.st_mode))
|
||||||
@@ -202,6 +210,7 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
filetype = PLAIN;
|
filetype = PLAIN;
|
||||||
|
#endif // _MSC_VER // was: WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look at the base name in the filename
|
// Look at the base name in the filename
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
// in. Search other files for "WIN32" or filenames ending in _win32.cxx
|
// in. Search other files for "WIN32" or filenames ending in _win32.cxx
|
||||||
// for other system-specific code.
|
// for other system-specific code.
|
||||||
|
|
||||||
#if defined(WIN32) and !defined(FL_DOXYGEN)
|
#if defined(WIN32) && !defined(FL_DOXYGEN)
|
||||||
|
|
||||||
/* We require Windows 2000 features (e.g. VK definitions) */
|
/* We require Windows 2000 features (e.g. VK definitions) */
|
||||||
# if !defined(WINVER) || (WINVER < 0x0500)
|
# if !defined(WINVER) || (WINVER < 0x0500)
|
||||||
|
|||||||
@@ -19,13 +19,11 @@
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
#include "../GDI/Fl_GDI_Graphics_Driver.H"
|
#include "../GDI/Fl_GDI_Graphics_Driver.H"
|
||||||
|
|
||||||
#include <FL/Fl_Printer.H>
|
#include <FL/Fl_Printer.H>
|
||||||
|
|
||||||
|
|
||||||
#include <FL/fl_ask.H>
|
#include <FL/fl_ask.H>
|
||||||
#include <FL/math.h>
|
#include <FL/math.h>
|
||||||
#include <FL/fl_draw.H>
|
#include <FL/fl_draw.H>
|
||||||
|
#include <Commdlg.h>
|
||||||
|
|
||||||
extern HWND fl_window;
|
extern HWND fl_window;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@
|
|||||||
*/
|
*/
|
||||||
# ifndef __WATCOMC__
|
# ifndef __WATCOMC__
|
||||||
# define strdup _strdup
|
# define strdup _strdup
|
||||||
# define unlink _unlink
|
# /* define unlink _unlink */
|
||||||
# endif /* !__WATCOMC__ */
|
# endif /* !__WATCOMC__ */
|
||||||
# elif defined(__EMX__)
|
# elif defined(__EMX__)
|
||||||
# define strcasecmp(s,t) stricmp((s), (t))
|
# define strcasecmp(s,t) stricmp((s), (t))
|
||||||
|
|||||||
Reference in New Issue
Block a user