]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Build fix
[wxWidgets.git] / src / common / filefn.cpp
index 9f61baf66d5c7d2b395cb8cda97c72e36415e0a0..0a7d12ab7bbb36ea96d814a9a53672bf23ecd53a 100644 (file)
 #include "wx/utils.h"
 #include <wx/intl.h>
 
+// there are just too many of those...
+#ifdef _MSC_VER
+    #pragma warning(disable:4706)   // assignment within conditional expression
+#endif // VC++
+
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 
 #ifdef __GNUWIN32__
 #include <sys/unistd.h>
-// #include <sys/stat.h>
-
-#ifndef __MINGW32__
-#include <std.h>
-#endif
-
 #define stricmp strcasecmp
 #endif
 
 
 #define _MAXPATHLEN 500
 
-#if !USE_SHARED_LIBRARY
+extern char *wxBuffer;
+
+#if !USE_SHARED_LIBRARIES
 IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
 #endif
 
-extern char *wxBuffer;
-
 void wxPathList::Add (const wxString& path)
 {
   wxStringList::Add ((char *)(const char *)path);
@@ -214,11 +213,18 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
 bool 
 wxFileExists (const wxString& filename)
 {
+#ifdef __GNUWIN32__ // (fix a B20 bug)
+  if (GetFileAttributes(filename) == 0xFFFFFFFF)
+    return FALSE;
+  else
+    return TRUE;
+#else
   struct stat stbuf;
 
   if (filename && stat ((char *)(const char *)filename, &stbuf) == 0)
     return TRUE;
   return FALSE;
+#endif
 }
 
 /* Vadim's alternative implementation
@@ -949,7 +955,7 @@ char *wxGetTempFileName(const wxString& prefix, char *buf)
 #else
   static short last_temp = 0;  // cache last to speed things a bit
   // At most 1000 temp files to a process! We use a ring count.
-  char tmp[100];
+  char tmp[100]; // FIXME static buffer
 
   for (short suffix = last_temp + 1; suffix != last_temp; ++suffix %= 1000)
     {
@@ -1023,7 +1029,7 @@ char *wxFindFirstFile(const char *spec, int flags)
 char *wxFindNextFile(void)
 {
 #ifndef __VMS__
-  static char buf[400];
+  static char buf[400]; // FIXME static buffer
 
   /* MATTHEW: [2] Don't crash if we read too many times */
   if (!wxDirStream)
@@ -1544,5 +1550,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special )
        pattern++;
     return ((*str == '\0') && (*pattern == '\0'));
 };
+
 #endif
 
+#ifdef _MSC_VER
+    #pragma warning(default:4706)   // assignment within conditional expression
+#endif // VC++