]> git.lyx.org Git - features.git/blobdiff - 3rdparty/boost/boost/smart_ptr/detail/lwm_win32_cs.hpp
Update to boost 1.68
[features.git] / 3rdparty / boost / boost / smart_ptr / detail / lwm_win32_cs.hpp
index 7d3e1561667871872284f860da9dd8f6596c2622..d8dccb0141b3b047fc812654f686ca7e1081f579 100644 (file)
@@ -61,10 +61,23 @@ extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(::_RTL_CRIT
 extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(::_RTL_CRITICAL_SECTION *);
 extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(::_RTL_CRITICAL_SECTION *);
 
-#else
+typedef ::_RTL_CRITICAL_SECTION rtl_critical_section;
+
+#else // #ifndef BOOST_USE_WINDOWS_H
 
 typedef ::CRITICAL_SECTION critical_section;
 
+#if BOOST_PLAT_WINDOWS_RUNTIME
+using ::InitializeCriticalSectionEx;
+#else
+using ::InitializeCriticalSection;
+#endif
+using ::EnterCriticalSection;
+using ::LeaveCriticalSection;
+using ::DeleteCriticalSection;
+
+typedef ::CRITICAL_SECTION rtl_critical_section;
+
 #endif // #ifndef BOOST_USE_WINDOWS_H
 
 class lightweight_mutex
@@ -81,15 +94,15 @@ public:
     lightweight_mutex()
     {
 #if BOOST_PLAT_WINDOWS_RUNTIME
-        boost::detail::InitializeCriticalSectionEx(reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(&cs_), 4000, 0);
+        boost::detail::InitializeCriticalSectionEx(reinterpret_cast< rtl_critical_section* >(&cs_), 4000, 0);
 #else
-        boost::detail::InitializeCriticalSection(reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(&cs_));
+        boost::detail::InitializeCriticalSection(reinterpret_cast< rtl_critical_section* >(&cs_));
 #endif
     }
 
     ~lightweight_mutex()
     {
-        boost::detail::DeleteCriticalSection(reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(&cs_));
+        boost::detail::DeleteCriticalSection(reinterpret_cast< rtl_critical_section* >(&cs_));
     }
 
     class scoped_lock;
@@ -108,12 +121,12 @@ public:
 
         explicit scoped_lock(lightweight_mutex & m): m_(m)
         {
-            boost::detail::EnterCriticalSection(reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(&m_.cs_));
+            boost::detail::EnterCriticalSection(reinterpret_cast< rtl_critical_section* >(&m_.cs_));
         }
 
         ~scoped_lock()
         {
-            boost::detail::LeaveCriticalSection(reinterpret_cast< ::_RTL_CRITICAL_SECTION* >(&m_.cs_));
+            boost::detail::LeaveCriticalSection(reinterpret_cast< rtl_critical_section* >(&m_.cs_));
         }
     };
 };