]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filefn.cpp
Applied patch [ 619386 ] uxtheme.dll support
[wxWidgets.git] / src / common / filefn.cpp
index 7f54e8896d5d7d25de63ed324e3cee762a5b1453..de78ad948a3e52ecd6ae72037363d342b1562c46 100644 (file)
 #ifndef __MWERKS__
     #include <sys/types.h>
     #include <sys/stat.h>
+#else
+#ifdef __MACH__
+#include <sys/types.h>
+#include <utime.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #else
     #include <stat.h>
     #include <unistd.h>
     #include <unix.h>
     #include <fcntl.h>
 #endif
+#endif
 
 #ifdef __UNIX__
     #include <unistd.h>
     #include <windows.h>
     #include "wx/msw/mslu.h"
 
+    // for _getcwd
+    #ifdef __MINGW32__
+        #include <io.h>
+    #endif
+
     // sys/cygwin.h is needed for cygwin_conv_to_full_win32_path()
     //
     // note that it must be included after <windows.h>
         #ifdef __CYGWIN__
             #include <sys/cygwin.h>
         #endif
-
-        #ifndef __TWIN32__
-            #include <sys/unistd.h>
-        #endif
     #endif // __GNUWIN32__
 #endif // __WINDOWS__
 
@@ -1399,7 +1407,7 @@ wxString wxFindFirstFile(const wxChar *spec, int flags)
     wxSplitPath(spec, &gs_dirPath, NULL, NULL);
     if ( gs_dirPath.IsEmpty() )
         gs_dirPath = wxT(".");
-    if ( gs_dirPath.Last() != wxFILE_SEP_PATH )
+    if ( !wxEndsWithPathSeparator(gs_dirPath ) )
         gs_dirPath << wxFILE_SEP_PATH;
 
     if (gs_dir)
@@ -1490,7 +1498,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz)
     if ( needsANSI )
 #endif // wxUSE_UNICODE
     {
-    #ifdef _MSC_VER
+    #if defined(_MSC_VER) || defined(__MINGW32__)
         ok = _getcwd(cbuf, sz) != NULL;
     #elif defined(__WXMAC__) && !defined(__DARWIN__)
         FSSpec cwdSpec ;