X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489f6cf713b6b5bd9746af238b260c7d13d1dc40..c0e7c9a98bb5cdfaccf4df3d13da846d022957f8:/src/common/filefn.cpp?ds=sidebyside diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 55aa0e7ce8..0df4b475a0 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -189,8 +189,8 @@ void wxPathList::AddEnvList (const wxString& envVariable) wxT(" :;"); #endif - wxChar *val = wxGetenv (WXSTRINGCAST envVariable); - if (val && *val) + wxString val ; + if (wxGetEnv (WXSTRINGCAST envVariable, &val)) { wxChar *s = MYcopystring (val); wxChar *save_ptr, *token = wxStrtok (s, PATH_TOKS, &save_ptr); @@ -1011,12 +1011,12 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) return false; } #elif defined(__OS2__) - if ( ::DosCopy(file2, file2, overwrite ? DCPY_EXISTING : 0) != 0 ) + if ( ::DosCopy((PSZ)file1.c_str(), (PSZ)file2.c_str(), overwrite ? DCPY_EXISTING : 0) != 0 ) return false; #elif defined(__PALMOS__) // TODO with http://www.palmos.com/dev/support/docs/protein_books/Memory_Databases_Files/ return false; -#else // !Win32 +#elif wxUSE_FILE // !Win32 wxStructStat fbuf; // get permissions of file1 @@ -1087,6 +1087,15 @@ wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) return false; } #endif // OS/2 || Mac + +#else // !Win32 && ! wxUSE_FILE + + // impossible to simulate with wxWidgets API + wxUnusedVar(file1); + wxUnusedVar(file2); + wxUnusedVar(overwrite); + return false; + #endif // __WXMSW__ && __WIN32__ return true; @@ -1195,7 +1204,7 @@ bool wxRmdir(const wxString& dir, int WXUNUSED(flags)) } // does the path exists? (may have or not '/' or '\\' at the end) -bool wxPathExists(const wxChar *pszPathName) +bool wxDirExists(const wxChar *pszPathName) { wxString strPath(pszPathName); @@ -1227,7 +1236,7 @@ bool wxPathExists(const wxChar *pszPathName) return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY); #elif defined(__OS2__) - return (::DosSetCurrentDir(WXSTRINGCAST strPath)); + return (::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath))); #else // !__WIN32__ wxStructStat st; @@ -1256,6 +1265,8 @@ wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf) return buf; #else + wxUnusedVar(prefix); + wxUnusedVar(buf); // wxFileName::CreateTempFileName needs wxFile class enabled return NULL; #endif @@ -1913,7 +1924,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) // wxFileKind wxGetFileKind(int fd) { -#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle +#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle && !defined(__WINE__) switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE) { case FILE_TYPE_CHAR: @@ -1954,12 +1965,14 @@ wxFileKind wxGetFileKind(int fd) wxFileKind wxGetFileKind(FILE *fp) { - // note: the watcom rtl dll doesn't have fileno (the static lib does) -#if !defined wxFILEKIND_STUB && !(defined __WATCOMC__ && defined __SW_BR) - return wxGetFileKind(fileno(fp)); -#else + // Note: The watcom rtl dll doesn't have fileno (the static lib does). + // Should be fixed in version 1.4. +#if defined(wxFILEKIND_STUB) || \ + (defined(__WATCOMC__) && __WATCOMC__ <= 1230 && defined(__SW_BR)) (void)fp; return wxFILE_KIND_DISK; +#else + return wxGetFileKind(fileno(fp)); #endif }