From a8a4cefb521bcb47aeac2b2a2f4cc055a685cdf1 Mon Sep 17 00:00:00 2001 From: Jeremiah Rodriguez Date: Tue, 26 May 2020 13:28:32 -0700 Subject: [PATCH] Add support for disabled exceptions --- include/boost/stacktrace/stacktrace.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/stacktrace/stacktrace.hpp b/include/boost/stacktrace/stacktrace.hpp index 3035801..c1692fa 100644 --- a/include/boost/stacktrace/stacktrace.hpp +++ b/include/boost/stacktrace/stacktrace.hpp @@ -13,6 +13,7 @@ #endif #include +#include #include #include @@ -69,7 +70,7 @@ class basic_stacktrace { return; } - try { + BOOST_TRY { { // Fast path without additional allocations native_frame_ptr_t buffer[buffer_size]; const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect(buffer, buffer_size < max_depth ? buffer_size : max_depth, frames_to_skip + 1); @@ -95,9 +96,10 @@ class basic_stacktrace { buf.resize(buf.size() * 2); } while (buf.size() < buf.max_size()); // close to `true`, but suppresses `C4127: conditional expression is constant`. - } catch (...) { + } BOOST_CATCH (...) { // ignore exception } + BOOST_CATCH_END } /// @endcond