From 2b2883a5eb26f2c5b03658daa044b5ea7a28d3ce Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 22 Aug 2007 10:41:32 +0000 Subject: [PATCH] Applied [ 1767537 ] [wxOS2]Watcom build - filefn git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/filefn.h | 4 ++-- src/common/filefn.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/wx/filefn.h b/include/wx/filefn.h index c47f40a2ca..9be5072ab9 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -159,7 +159,7 @@ enum wxFileKind #define wxCRT_RmDir _wrmdir #define wxCRT_Stat _wstat #define wxStructStat struct _stat -#elif defined(__WXMSW__) && !defined(__WXPALMOS__) && \ +#elif (defined(__WXMSW__) || defined(__OS2__)) && !defined(__WXPALMOS__) && \ ( \ defined(__VISUALC__) || \ (defined(__MINGW32__) && !defined(__WINE__) && \ @@ -436,7 +436,7 @@ inline int wxLstat(const wxString& path, wxStructStat *buf) { return wxCRT_Lstat(path.fn_str(), buf); } inline int wxRmDir(const wxString& path) { return wxCRT_RmDir(path.fn_str()); } -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) || (defined(__OS2__) && defined(__WATCOMC__)) inline int wxMkDir(const wxString& path, mode_t WXUNUSED(mode) = 0) { return wxCRT_MkDir(path.fn_str()); } #else diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index c2614443c7..b072f52667 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1647,10 +1647,10 @@ bool wxSetWorkingDirectory(const wxString& d) if (d[1] == ':') { ::DosSetDefaultDisk(wxToupper(d[0]) - _T('A') + 1); - // do not call DosSetCurrentDir when just changing drive, - // since it requires e.g. "d:." instead of "d:"! - if (d.length() == 2) - return true; + // do not call DosSetCurrentDir when just changing drive, + // since it requires e.g. "d:." instead of "d:"! + if (d.length() == 2) + return true; } return (::DosSetCurrentDir(d.c_str()) == 0); #elif defined(__UNIX__) || defined(__WXMAC__) || defined(__DOS__) @@ -1915,7 +1915,7 @@ bool wxIsWritable(const wxString &path) { #if defined( __UNIX__ ) || defined(__OS2__) // access() will take in count also symbolic links - return access(path.fn_str(), W_OK) == 0; + return wxAccess(path.fn_str(), W_OK) == 0; #elif defined( __WINDOWS__ ) return wxCheckWin32Permission(path, GENERIC_WRITE); #else @@ -1929,7 +1929,7 @@ bool wxIsReadable(const wxString &path) { #if defined( __UNIX__ ) || defined(__OS2__) // access() will take in count also symbolic links - return access(path.fn_str(), R_OK) == 0; + return wxAccess(path.fn_str(), R_OK) == 0; #elif defined( __WINDOWS__ ) return wxCheckWin32Permission(path, GENERIC_READ); #else @@ -1943,7 +1943,7 @@ bool wxIsExecutable(const wxString &path) { #if defined( __UNIX__ ) || defined(__OS2__) // access() will take in count also symbolic links - return access(path.fn_str(), X_OK) == 0; + return wxAccess(path.fn_str(), X_OK) == 0; #elif defined( __WINDOWS__ ) return wxCheckWin32Permission(path, GENERIC_EXECUTE); #else -- 2.45.2