X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9802983f157c32177e92e8c0f6b1ce44aec0ebca..068b764a5a7cc2929b1fd8ea5643f43b5cbc8762:/src/common/filefn.cpp diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 9f34f44509..37df0c74db 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -214,7 +214,9 @@ void wxPathList::AddEnvList (const wxString& envVariable) delete [] s; } -#endif +#else // __WXWINCE__ + wxUnusedVar(envVariable); +#endif // !__WXWINCE__/__WXWINCE__ } // Given a full filename (with path), ensure that that file can @@ -671,7 +673,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin const wxChar *val; #ifndef __WXWINCE__ wxChar *tcp; - if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && + if (!envname.empty() && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && (tcp = wxStrstr (dest, val)) != NULL) { wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val)); @@ -681,6 +683,8 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin wxStrcat (tcp, wxT("}")); wxStrcat (tcp, wxFileFunctionsBuffer); } +#else + wxUnusedVar(envname); #endif // Handle User's home (ignore root homes!) @@ -1191,7 +1195,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); @@ -1222,6 +1226,8 @@ bool wxPathExists(const wxChar *pszPathName) DWORD ret = ::GetFileAttributes(strPath); return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY); +#elif defined(__OS2__) + return (::DosSetCurrentDir(WXSTRINGCAST strPath)); #else // !__WIN32__ wxStructStat st; @@ -1330,6 +1336,9 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) // TODO ? return NULL; #elif defined(__WXWINCE__) + // TODO + wxUnusedVar(buf); + wxUnusedVar(sz); return NULL; #else if ( !buf ) @@ -1471,6 +1480,7 @@ bool wxSetWorkingDirectory(const wxString& d) #ifdef __WIN32__ #ifdef __WXWINCE__ // No equivalent in WinCE + wxUnusedVar(d); return false; #else return (bool)(SetCurrentDirectory(d) != 0); @@ -1724,7 +1734,7 @@ int WXDLLEXPORT wxParseCommonDialogsFilter(const wxString& filterStr, wxArrayStr // autocompletion for( size_t j = 0 ; j < descriptions.GetCount() ; j++ ) { - if ( descriptions[j] == wxEmptyString && filters[j] != wxEmptyString ) + if ( descriptions[j].empty() && !filters[j].empty() ) { descriptions[j].Printf(_("Files (%s)"), filters[j].c_str()); } @@ -1892,7 +1902,7 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) // This is important for the archive streams, which benefit greatly from // being able to seek on a stream, but which will produce corrupt archives // if they unknowingly seek on a non-seekable stream. -// +// // wxFILE_KIND_DISK is a good catch all return value, since other values // disable features of the archive streams. Some other value must be returned // for a file type that appears seekable but isn't. @@ -1944,11 +1954,14 @@ wxFileKind wxGetFileKind(int fd) wxFileKind wxGetFileKind(FILE *fp) { -#ifndef wxFILEKIND_STUB - 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 }