diff options
Diffstat (limited to 'bridges/source/cpp_uno/msvc_shared/except.cxx')
-rw-r--r-- | bridges/source/cpp_uno/msvc_shared/except.cxx | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx b/bridges/source/cpp_uno/msvc_shared/except.cxx index c9432af4e67b..b6c6715e0336 100644 --- a/bridges/source/cpp_uno/msvc_shared/except.cxx +++ b/bridges/source/cpp_uno/msvc_shared/except.cxx @@ -21,6 +21,7 @@ #include <memory> +#include <cstdlib> #include <malloc.h> #include <new.h> #include <typeinfo> @@ -51,7 +52,7 @@ using namespace ::com::sun::star; -static OUString toUNOname(OUString const& rRTTIname) throw() +static OUString toUNOname(OUString const& rRTTIname) noexcept { OUStringBuffer aRet(64); OUString aStr(rRTTIname.copy(4, rRTTIname.getLength() - 4 - 2)); // filter .?AUzzz@yyy@xxx@@ @@ -59,7 +60,7 @@ static OUString toUNOname(OUString const& rRTTIname) throw() while (nPos > 0) { sal_Int32 n = aStr.lastIndexOf('@', nPos); - aRet.append(aStr.copy(n + 1, nPos - n - 1)); + aRet.append(aStr.subView(n + 1, nPos - n - 1)); if (n >= 0) aRet.append('.'); nPos = n; @@ -67,7 +68,7 @@ static OUString toUNOname(OUString const& rRTTIname) throw() return aRet.makeStringAndClear(); } -static OUString toRTTIname(OUString const& rUNOname) throw() +static OUString toRTTIname(OUString const& rUNOname) noexcept { OUStringBuffer aRet(64); aRet.append(".?AV"); // class ".?AV"; struct ".?AU" @@ -75,17 +76,16 @@ static OUString toRTTIname(OUString const& rUNOname) throw() while (nPos > 0) { sal_Int32 n = rUNOname.lastIndexOf('.', nPos); - aRet.append(rUNOname.copy(n + 1, nPos - n - 1)); - aRet.append('@'); + aRet.append(OUString::Concat(rUNOname.subView(n + 1, nPos - n - 1)) + "@"); nPos = n; } aRet.append('@'); return aRet.makeStringAndClear(); } -ExceptionTypeInfo::~ExceptionTypeInfo() throw() { (void)m_data; } +ExceptionTypeInfo::~ExceptionTypeInfo() noexcept { (void)m_data; } -ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) throw() +ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) noexcept { ExceptionTypeInfoWrapper* pRTTI; t_string2PtrMap::const_iterator const iFind(m_allRTTI.find(rUNOname)); @@ -107,7 +107,7 @@ ExceptionTypeInfoWrapper* RTTInfos::getInfo(OUString const& rUNOname) throw() return pRTTI; } -type_info* RTTInfos::get(OUString const& rUNOname, int* len) throw() +type_info* RTTInfos::get(OUString const& rUNOname, int* len) noexcept { static RTTInfos* s_pRTTIs = new RTTInfos(); @@ -121,22 +121,22 @@ type_info* RTTInfos::get(OUString const& rUNOname, int* len) throw() return pETIW->get_type_info(); } -RTTInfos::RTTInfos() throw() {} +RTTInfos::RTTInfos() noexcept {} DWORD ExceptionInfos::allocationGranularity = 0; -ExceptionInfos::ExceptionInfos() throw() {} +ExceptionInfos::ExceptionInfos() noexcept {} -ExceptionInfos::~ExceptionInfos() throw() +ExceptionInfos::~ExceptionInfos() noexcept { SAL_INFO("bridges", "> freeing exception infos... <"); - osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); for (auto& rEntry : m_allRaiseInfos) delete static_cast<RaiseInfo*>(rEntry.second); } -RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) throw() +RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) noexcept { static ExceptionInfos* s_pInfos = []() { #if defined _M_AMD64 || defined _M_ARM64 @@ -154,7 +154,7 @@ RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) throw() RaiseInfo* pRaiseInfo; OUString const& rTypeName = OUString::unacquired(&pTD->pTypeName); - osl::MutexGuard aGuard(s_pInfos->m_aMutex); + std::unique_lock aGuard(s_pInfos->m_aMutex); t_string2PtrMap::const_iterator const iFind(s_pInfos->m_allRaiseInfos.find(rTypeName)); if (iFind != s_pInfos->m_allRaiseInfos.end()) pRaiseInfo = static_cast<RaiseInfo*>(iFind->second); @@ -197,6 +197,7 @@ void msvc_raiseException(uno_Any* pUnoExc, uno_Mapping* pUno2Cpp) // last point to release anything not affected by stack unwinding RaiseException(MSVC_EH_MAGIC_CODE, EXCEPTION_NONCONTINUABLE, MSVC_EH_PARAMETERS, arFilterArgs); + std::abort(); } // This function does the same check as __CxxDetectRethrow from msvcrt (see its |