From e321cb37bfe0379f54010eb42a36573ca561e71f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Sun, 27 Nov 2005 14:45:48 +0000 Subject: VC++ 2005 Support, drop old files, add icons for Sudoku git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4660 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/.cvsignore | 6 ------ src/Fl_File_Chooser2.cxx | 10 +++++++--- src/Fl_File_Icon2.cxx | 5 ++++- src/Fl_Help_View.cxx | 3 +++ src/Fl_Preferences.cxx | 4 ++++ src/Fl_get_system_colors.cxx | 5 +++++ src/filename_absolute.cxx | 12 +++++++----- src/fl_arc.cxx | 6 ++++++ src/flstring.h | 10 ++++++++-- 9 files changed, 44 insertions(+), 17 deletions(-) delete mode 100644 src/.cvsignore (limited to 'src') diff --git a/src/.cvsignore b/src/.cvsignore deleted file mode 100644 index f654a4eaa..000000000 --- a/src/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -*.so* -*.sl* -*.a -*.bck -*.sav -*.dylib diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index a761e52f6..648d8a7ab 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -62,6 +62,10 @@ #if defined(WIN32) && ! defined (__CYGWIN__) # include # include +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define access _access +# define mkdir _mkdir // Apparently Borland C++ defines DIRECTORY in , which // interfers with the Fl_File_Icon enumeration of the same name. # ifdef DIRECTORY @@ -608,7 +612,7 @@ Fl_File_Chooser::fileNameCB() file = fileList->text(i); #if (defined(WIN32) && ! defined(__CYGWIN__)) || defined(__EMX__) - if (strnicmp(filename, file, min_match) == 0) { + if (strncasecmp(filename, file, min_match) == 0) { #else if (strncmp(filename, file, min_match) == 0) { #endif // WIN32 || __EMX__ @@ -631,7 +635,7 @@ Fl_File_Chooser::fileNameCB() // Succeeding match; compare to find maximum string match... while (max_match > min_match) #if (defined(WIN32) && ! defined(__CYGWIN__)) || defined(__EMX__) - if (strnicmp(file, matchname, max_match) == 0) + if (strncasecmp(file, matchname, max_match) == 0) #else if (strncmp(file, matchname, max_match) == 0) #endif // WIN32 || __EMX__ @@ -1187,7 +1191,7 @@ compare_dirnames(const char *a, const char *b) { // Do a comparison of the first N chars (alen == blen at this point)... #ifdef WIN32 - return strnicmp(a, b, alen); + return strncasecmp(a, b, alen); #else return strncmp(a, b, alen); #endif // WIN32 diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx index b7a23ac7e..29ab50191 100644 --- a/src/Fl_File_Icon2.cxx +++ b/src/Fl_File_Icon2.cxx @@ -50,9 +50,12 @@ #include #include #include -#if defined(WIN32) && ! defined(__CYGWIN__) +#if defined(WIN32) && !defined(__CYGWIN__) # include # define F_OK 0 +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define access _access #else # include #endif // WIN32 diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 86e45fd3a..3b930116f 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -66,6 +66,9 @@ #if defined(WIN32) && ! defined(__CYGWIN__) # include # include +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define getcwd _getcwd #else # include #endif // WIN32 diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx index c116ae2a5..98321d28a 100644 --- a/src/Fl_Preferences.cxx +++ b/src/Fl_Preferences.cxx @@ -39,6 +39,10 @@ #if defined(WIN32) && !defined(__CYGWIN__) # include # include +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define access _access +# define mkdir _mkdir #elif defined (__APPLE__) # include # include diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index bac2c7c94..f2e5746fa 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -40,6 +40,11 @@ extern "C" int putenv(const char*); #endif // __APPLE__ && __MWERKS__ +#ifdef WIN32 +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define putenv _putenv +#endif // WIN32 static char fl_bg_set = 0; static char fl_bg2_set = 0; diff --git a/src/filename_absolute.cxx b/src/filename_absolute.cxx index abec59127..d4101cfec 100644 --- a/src/filename_absolute.cxx +++ b/src/filename_absolute.cxx @@ -37,12 +37,14 @@ #include #if defined(WIN32) && !defined(__CYGWIN__) # include -//# define getcwd(a,b) _getdcwd(0,a,b) +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define getcwd _getcwd #else -# include -# ifdef __EMX__ -# define getcwd _getcwd2 -# endif +# include +# ifdef __EMX__ +# define getcwd _getcwd2 +# endif #endif #if defined(WIN32) || defined(__EMX__) && !defined(__CYGWIN__) diff --git a/src/fl_arc.cxx b/src/fl_arc.cxx index 8e16c2c02..3b50a32e2 100644 --- a/src/fl_arc.cxx +++ b/src/fl_arc.cxx @@ -32,6 +32,12 @@ #include #include +#ifdef WIN32 +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... +# define hypot _hypot +#endif // WIN32 + void fl_arc(double x, double y, double r, double start, double end) { // draw start point accurately: diff --git a/src/flstring.h b/src/flstring.h index db9f97038..eb6d18ea3 100644 --- a/src/flstring.h +++ b/src/flstring.h @@ -30,6 +30,7 @@ # include # include +# include # include # include # ifdef HAVE_STRINGS_H @@ -48,8 +49,13 @@ # endif /* index */ # if defined(WIN32) && !defined(__CYGWIN__) -# define strcasecmp(s,t) stricmp((s), (t)) -# define strncasecmp(s,t,n) strnicmp((s), (t), (n)) +# define strcasecmp(s,t) _stricmp((s), (t)) +# define strncasecmp(s,t,n) _strnicmp((s), (t), (n)) +// Visual C++ 2005 incorrectly displays a warning about the use of POSIX APIs +// on Windows, which is supposed to be POSIX compliant... Some of these functions +// are also defined in ISO C99... +# define strdup _strdup +# define unlink _unlink # elif defined(__EMX__) # define strcasecmp(s,t) stricmp((s), (t)) # define strncasecmp(s,t,n) strnicmp((s), (t), (n)) -- cgit v1.2.3