]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/regex/src/fileiter.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / regex / src / fileiter.cpp
index c80459b86691d679106a1b669be2592ab129f7f1..0c027ec108fadfabda2a74c7f56d165bd6955e60 100644 (file)
@@ -61,7 +61,7 @@ namespace boost{
    namespace BOOST_REGEX_DETAIL_NS{
 // start with the operating system specific stuff:
 
-#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
+#if (defined(BOOST_BORLANDC) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
 
 // platform is DOS or Windows
 // directories are separated with '\\'
@@ -112,16 +112,21 @@ void mapfile::open(const char* file)
          std::runtime_error err("Unable to create file mapping.");
          boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
       }
-      _first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
-      if(_first == 0)
+      else
       {
-         CloseHandle(hmap);
-         CloseHandle(hfile);
-         hmap = 0;
-         hfile = 0;
-         std::runtime_error err("Unable to create file mapping.");
+         _first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
+         if (_first == 0)
+         {
+            CloseHandle(hmap);
+            CloseHandle(hfile);
+            hmap = 0;
+            hfile = 0;
+            std::runtime_error err("Unable to create file mapping.");
+            boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
+         }
+         else
+            _last = _first + GetFileSize(hfile, 0);
       }
-      _last = _first + GetFileSize(hfile, 0);
    }
    else
    {