]> git.lyx.org Git - lyx.git/commitdiff
Use __MINGW32__ macro rather than __MINGW__.
authorAngus Leeming <leeming@lyx.org>
Fri, 30 Sep 2005 20:44:10 +0000 (20:44 +0000)
committerAngus Leeming <leeming@lyx.org>
Fri, 30 Sep 2005 20:44:10 +0000 (20:44 +0000)
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

boost/ChangeLog
boost/libs/filesystem/src/operations_posix_windows.cpp

index 89688b0a686fbe4b782c5836a20cb029056ad1e0..1e0a8ff2176798c9469585d9b32bec03b0e4dc99 100644 (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
index a75a1bca8e48b8534d7c709d135f63440e6c3e79..0d990b1c7584b3ce08393726b9523f3fe295bfa9 100644 (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)