Use __MINGW32__ macro rather than __MINGW__.

Add ERROR_ACCESS_DENIED to list of "recognized" failures of exists(path) to keep Win98SE happy.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10502 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2005-09-30 20:44:10 +00:00
parent 73e1a6a470
commit c390d455fd
2 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,15 @@
2005-09-30 Angus Leeming <leeming@lyx.org>
* libs/filesystem/src/operations_posix_windows.cpp (exists):
add ERROR_ACCESS_DENIED to the list of "recognised" errors. It
appears that Win98SE returns such an error from GetFileAttributes
if asked to query a path on a drive that doesn't exist.
The "correct" fix is currently being discussed on the boost-devel
list, but this work around will do for us for now.
2005-09-30 Angus Leeming <leeming-0hXrFu2P2+c@public.gmane.org>
* libs/filesystem/src/operations_posix_windows.cpp: add a block
of preprocessor code to include NewAPIs.h conditioned on the
WANT_GETFILEATTRIBUTESEX_WRAPPER macro. Enables runtime support

View File

@ -66,7 +66,7 @@ namespace fs = boost::filesystem;
//
//////////////////////////////////////////////////////////////////////
# if defined(WANT_GETFILEATTRIBUTESEX_WRAPPER)
# if (defined(__MINGW__) || defined(__CYGWIN__)) && WINVER < 0x040A
# if (defined(__MINGW32__) || defined(__CYGWIN__)) && WINVER < 0x040A
// MinGW/Cygwin's winapi header files and NewAPIs.h do not live
// well together because NewAPIs.h redefines
// WIN32_FILE_ATTRIBUTE_DATA and GET_FILEEX_INFO_LEVELS
@ -369,7 +369,11 @@ namespace boost
if(::GetFileAttributesA( ph.string().c_str() ) == 0xFFFFFFFF)
{
UINT err = ::GetLastError();
if((err == ERROR_FILE_NOT_FOUND) || (err == ERROR_INVALID_PARAMETER) || (err == ERROR_PATH_NOT_FOUND) || (err == ERROR_INVALID_NAME))
if((err == ERROR_FILE_NOT_FOUND) ||
(err == ERROR_INVALID_PARAMETER) ||
(err == ERROR_PATH_NOT_FOUND) ||
(err == ERROR_INVALID_NAME) ||
(err == ERROR_ACCESS_DENIED))
return false; // GetFileAttributes failed because the path does not exist
// for any other error we assume the file does exist and fall through,
// this may not be the best policy though... (JM 20040330)