X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2432b92dd7a837db13d3938a56c1959decd03203..dd9a3de816bb5e048a2b99837a508542a91235f0:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 9027d5e2dc..e828319ae0 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -57,14 +57,17 @@ #endif #ifdef __WINDOWS__ -#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) +#if !defined( __GNUWIN32__ ) && !defined( __MWERKS__ ) && !defined(__SALFORDC__) #include #include #endif #endif #ifdef __GNUWIN32__ +#ifndef __TWIN32__ #include +#endif + #define stricmp strcasecmp #endif @@ -74,6 +77,11 @@ #include #endif +#ifdef __SALFORDC__ +#include +#include +#endif + #include "wx/setup.h" #include "wx/log.h" @@ -174,7 +182,8 @@ wxString wxPathList::FindValidPath (const wxString& file) char buf[_MAXPATHLEN]; strcpy(buf, wxBuffer); - char *filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (char *)buf; + char *filename = (char*) NULL; /* shut up buggy egcs warning */ + filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (char *)buf; for (wxNode * node = First (); node; node = node->Next ()) { @@ -239,7 +248,12 @@ wxFileExists (const wxString& filename) return TRUE; return FALSE ; #else + +#ifdef __SALFORDC__ + struct _stat stbuf; +#else struct stat stbuf; +#endif if ((filename != "") && stat ((char *)(const char *)filename, &stbuf) == 0) return TRUE; @@ -647,7 +661,9 @@ wxString wxFileNameFromPath (const wxString& path1) return wxString(path + 2); #endif } - return wxString(""); + // Yes, this should return the path, not an empty string, otherwise + // we get "thing.txt" -> "". + return path1; } // Return just the directory, or NULL if no directory @@ -989,8 +1005,14 @@ bool wxRmdir(const wxString& dir, int WXUNUSED(flags)) wxUnix2MacFilename( gwxMacFileName ) ; return (rmdir(WXSTRINGCAST gwxMacFileName) == 0); #else + +#ifdef __SALFORDC__ + return FALSE; // What to do? +#else return (rmdir(WXSTRINGCAST dir) == 0); #endif + +#endif } #if 0 @@ -1048,8 +1070,13 @@ bool wxPathExists(const char *pszPathName) if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != '\0' ) strPath.Last() = '\0'; +#ifdef __SALFORDC__ + struct _stat st; +#else struct stat st; - return stat(strPath, &st) == 0 && (st.st_mode & S_IFDIR); +#endif + + return stat((char*) (const char*) strPath, &st) == 0 && (st.st_mode & S_IFDIR); } // Get a temporary filename, opening and closing the file.