From 1dbccb5e3d91f0a04996c36518316792cd09143a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 29 Jun 2023 00:03:28 +1000 Subject: [PATCH] 3rdparty: Remove exception usage --- 3rdparty/demangler/src/gparser.cpp | 20 +++----------------- 3rdparty/rainterface/RA_Interface.cpp | 4 ++-- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/3rdparty/demangler/src/gparser.cpp b/3rdparty/demangler/src/gparser.cpp index b4928772f7..49943f06a9 100644 --- a/3rdparty/demangler/src/gparser.cpp +++ b/3rdparty/demangler/src/gparser.cpp @@ -4764,23 +4764,9 @@ void cGram::demangleClassName(const std::string& input, cName* retvalue, cGram:: std::string sLength = match[1]; std::string name = match[2]; - unsigned long length = 0; - - bool ok = true; - try { - length = std::stoul(sLength); - } - catch (const std::invalid_argument&) { - ok = false; - } - catch (const std::out_of_range&) { - ok = false; - } - - if (ok) { - if (name.length() == length) { - className = name; - } + unsigned long length = std::stoul(sLength); + if (name.length() == length) { + className = name; } } } diff --git a/3rdparty/rainterface/RA_Interface.cpp b/3rdparty/rainterface/RA_Interface.cpp index 2152538500..69410486b8 100644 --- a/3rdparty/rainterface/RA_Interface.cpp +++ b/3rdparty/rainterface/RA_Interface.cpp @@ -989,11 +989,11 @@ void RA_Shutdown() // Call shutdown on toolchain if (_RA_Shutdown != nullptr) { -#ifdef __cplusplus +#if defined(__cplusplus) && _HAS_EXCEPTIONS try { #endif _RA_Shutdown(); -#ifdef __cplusplus +#if defined(__cplusplus) && _HAS_EXCEPTIONS } catch (std::runtime_error&) { }