From f3660dcb2f3b7fe836bebaee720332b4ea50a35b Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 17 Nov 2004 15:16:58 +0000 Subject: [PATCH] wxStat call preliminary fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 6 +++++- src/generic/filedlgg.cpp | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 1ed5377151..c33c44c174 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -298,7 +298,11 @@ wxFileExists (const wxString& filename) return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY); #else // !__WIN32__ wxStructStat st; - return wxStat(filename, &st) == 0 && (st.st_mode & S_IFREG); +#ifndef wxNEED_WX_UNISTD_H + return wxStat( filename.fn_str() , &st) == 0 && (st.st_mode & S_IFREG); +#else + return wxStat( filename , &st) == 0 && (st.st_mode & S_IFREG); +#endif #endif // __WIN32__/!__WIN32__ } diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index a39f76d034..644fbe5576 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -200,7 +200,13 @@ void wxFileData::ReadData() lstat( m_filePath.fn_str(), &buff ); m_type |= S_ISLNK( buff.st_mode ) != 0 ? is_link : 0; #else // no lstat() + // only translate to file charset if we don't go by our + // wxStat implementation +#ifndef wxNEED_WX_UNISTD_H + wxStat( m_filePath.fn_str() , &buff ); +#else wxStat( m_filePath, &buff ); +#endif #endif m_type |= (buff.st_mode & S_IFDIR) != 0 ? is_dir : 0; -- 2.47.2