//
// note that it must be included after <windows.h>
#ifdef __GNUWIN32__
- #include <sys/cygwin.h>
+ #ifdef __CYGWIN__
+ #include <sys/cygwin.h>
+ #endif
#include <wchar.h>
#ifndef __TWIN32__
#include <sys/unistd.h>
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// GetFileAttributes can copy with network paths unlike stat()
DWORD ret = ::GetFileAttributes(filename);
- if ( ret == (DWORD)-1 )
- {
- wxLogLastError(_T("GetFileAttributes"));
-
- return FALSE;
- }
- return !(ret & FILE_ATTRIBUTE_DIRECTORY);
+ return (ret != (DWORD)-1) && !(ret & FILE_ATTRIBUTE_DIRECTORY);
#else
wxStructStat stbuf;
if ( !filename.empty() && wxStat (OS_FILENAME(filename), &stbuf) == 0 )
#if defined(__WIN32__) && !defined(__WXMICROWIN__)
// stat() can't cope with network paths
DWORD ret = ::GetFileAttributes(strPath);
- if ( ret == (DWORD)-1 )
- {
- wxLogLastError(_T("GetFileAttributes"));
-
- return FALSE;
- }
- return (ret & FILE_ATTRIBUTE_DIRECTORY) != 0;
+ return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY);
#else // !__WIN32__
wxStructStat st;
}
#endif // __DJGPP__
-#ifdef __GNUWIN32__
+#ifdef __CYGWIN__
// another example of DOS/Unix mix (Cygwin)
wxString pathUnix = buf;
cygwin_conv_to_full_win32_path(pathUnix, buf);
-#endif // __GNUWIN32__
+#endif // __CYGWIN__
// finally convert the result to Unicode if needed
#if wxUSE_UNICODE && !defined(HAVE_WGETCWD)