diff --git a/include/boost/log/detail/code_conversion.hpp b/include/boost/log/detail/code_conversion.hpp index 587aa53..4c39f9c 100644 --- a/include/boost/log/detail/code_conversion.hpp +++ b/include/boost/log/detail/code_conversion.hpp @@ -35,6 +35,9 @@ namespace aux { BOOST_LOG_API void code_convert(const wchar_t* str1, std::size_t len, std::string& str2, std::locale const& loc = std::locale()); //! The function converts one string to the character type of another BOOST_LOG_API void code_convert(const char* str1, std::size_t len, std::wstring& str2, std::locale const& loc = std::locale()); + +// Note: MSVC 2015 (aka VC14) implement char16_t and char32_t types but not codecvt locale facets +#if !defined(BOOST_MSVC) #if !defined(BOOST_NO_CXX11_CHAR16_T) //! The function converts one string to the character type of another BOOST_LOG_API void code_convert(const char16_t* str1, std::size_t len, std::string& str2, std::locale const& loc = std::locale()); @@ -47,6 +50,7 @@ BOOST_LOG_API void code_convert(const char32_t* str1, std::size_t len, std::stri //! The function converts one string to the character type of another BOOST_LOG_API void code_convert(const char* str1, std::size_t len, std::u32string& str2, std::locale const& loc = std::locale()); #endif +#endif // !defined(BOOST_MSVC) //! The function converts one string to the character type of another template< typename CharT, typename SourceTraitsT, typename SourceAllocatorT, typename TargetTraitsT, typename TargetAllocatorT > diff --git a/src/code_conversion.cpp b/src/code_conversion.cpp index 5818b1f..c4288fe 100644 --- a/src/code_conversion.cpp +++ b/src/code_conversion.cpp @@ -125,6 +125,9 @@ BOOST_LOG_API void code_convert(const char* str1, std::size_t len, std::wstring& code_convert(str1, str1 + len, str2, std::use_facet< std::codecvt< wchar_t, char, std::mbstate_t > >(loc)); } +// Note: MSVC 2015 (aka VC14) implement char16_t and char32_t types but not codecvt locale facets +#if !defined(BOOST_MSVC) + #if !defined(BOOST_NO_CXX11_CHAR16_T) //! The function converts one string to the character type of another @@ -157,6 +160,8 @@ BOOST_LOG_API void code_convert(const char* str1, std::size_t len, std::u32strin #endif +#endif // !defined(BOOST_MSVC) + } // namespace aux BOOST_LOG_CLOSE_NAMESPACE // namespace log diff --git a/src/unhandled_exception_count.cpp b/src/unhandled_exception_count.cpp index 5fb9d75..c8eebe1 100644 --- a/src/unhandled_exception_count.cpp +++ b/src/unhandled_exception_count.cpp @@ -49,8 +49,8 @@ extern "C" void* __cxa_get_globals(); #elif defined(_MSC_VER) #if _MSC_VER >= 1900 // Visual Studio 14 has redesigned CRT -#define BOOST_LOG_HAS_VCRT_GETPTD -extern "C" void* __vcrt_getptd(); +#define BOOST_LOG_HAS_PROCESSING_THROW +extern "C" int* __processing_throw(); #elif _MSC_VER >= 1400 #define BOOST_LOG_HAS_GETPTD extern "C" void* _getptd(); @@ -68,9 +68,9 @@ BOOST_LOG_API unsigned int unhandled_exception_count() BOOST_NOEXCEPT #elif defined(BOOST_LOG_HAS_GETPTD) // MSVC specific. Tested on {MSVC2005SP1,MSVC2008SP1,MSVC2010SP1,MSVC2012}x{x32,x64}. return *(reinterpret_cast< const unsigned int* >(static_cast< const char* >(_getptd()) + (sizeof(void*) == 8 ? 0x100 : 0x90))); // _tiddata::_ProcessingThrow, x32 offset - 0x90, x64 - 0x100 -#elif defined(BOOST_LOG_HAS_VCRT_GETPTD) +#elif defined(BOOST_LOG_HAS_PROCESSING_THROW) // MSVC specific. Tested on {MSVC 14 CTP}x{x32,x64}. - return *(reinterpret_cast< const unsigned int* >(static_cast< const char* >(__vcrt_getptd()) + (sizeof(void*) == 8 ? 0x38 : 0x1c))); // __vcrt_ptd::_ProcessingThrow, x32 offset - 0x1c, x64 - 0x38 + return static_cast< unsigned int >(*__processing_throw()); #else // Portable implementation. Does not allow to detect multiple nested exceptions. return static_cast< unsigned int >(std::uncaught_exception());