Win16 compilation fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-01-26 21:59:13 +00:00
parent d8908b52e6
commit 2db300c664

View File

@@ -299,11 +299,17 @@ wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
bool
wxFileExists (const wxString& filename)
{
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// GetFileAttributes can copy with network paths
DWORD ret = GetFileAttributes(filename);
DWORD isDir = (ret & FILE_ATTRIBUTE_DIRECTORY);
return ((ret != 0xffffffff) && (isDir == 0));
DWORD ret = ::GetFileAttributes(filename);
if ( ret == (DWORD)-1 )
{
wxLogLastError(_T("GetFileAttributes"));
return FALSE;
}
return !(ret & FILE_ATTRIBUTE_DIRECTORY);
#else
wxStructStat stbuf;
if ( !filename.empty() && wxStat (OS_FILENAME(filename), &stbuf) == 0 )
@@ -1274,11 +1280,17 @@ bool wxPathExists(const wxChar *pszPathName)
}
#endif // __WINDOWS__
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// Stat can't cope with network paths
DWORD ret = GetFileAttributes(strPath.c_str());
DWORD isDir = (ret & FILE_ATTRIBUTE_DIRECTORY);
return ((ret != 0xffffffff) && (isDir != 0));
DWORD ret = ::GetFileAttributes(filename);
if ( ret == (DWORD)-1 )
{
wxLogLastError(_T("GetFileAttributes"));
return FALSE;
}
return (ret & FILE_ATTRIBUTE_DIRECTORY) != 0;
#else
wxStructStat st;