1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef BOOST_STACKTRACE_THIS_THREAD_HPP
- #define BOOST_STACKTRACE_THIS_THREAD_HPP
- #include <boost/config.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- # pragma once
- #endif
- #include <boost/stacktrace/stacktrace.hpp>
- namespace boost { namespace stacktrace { namespace this_thread {
- inline void set_capture_stacktraces_at_throw(bool enable = true) noexcept {
- #if defined(__GNUC__) && defined(__ELF__)
- if (impl::ref_capture_stacktraces_at_throw) {
- impl::ref_capture_stacktraces_at_throw() = enable;
- }
- #elif defined(BOOST_MSVC)
- if (bool* p = boost_stacktrace_impl_ref_capture_stacktraces_at_throw()) {
- *p = enable;
- }
- #endif
- (void)enable;
- }
- inline bool get_capture_stacktraces_at_throw() noexcept {
- #if defined(__GNUC__) && defined(__ELF__)
- if (impl::ref_capture_stacktraces_at_throw) {
- return impl::ref_capture_stacktraces_at_throw();
- }
- #elif defined(BOOST_MSVC)
- if (bool* p = boost_stacktrace_impl_ref_capture_stacktraces_at_throw()) {
- return *p;
- }
- #endif
- return false;
- }
- }}}
- #endif
|