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