From a70cf7935adbc1522d2793dfc64a4ff0dfb19a9a Mon Sep 17 00:00:00 2001 From: Ben Dunkin Date: Sun, 12 May 2024 19:56:38 -0700 Subject: [PATCH] Fix missing cxxabi.h include on Windows when using libc++ (#122) Make operator precedence explicit so the `CPPTRACE_HAS_CXX_EXCEPTION_TYPE` define is a dominant switch to use cxxabi.h, rather than one that only applies when `__GLIBCXX__` is defined. Fixes https://github.com/jeremy-rifkin/cpptrace/issues/121 --- src/utils/exception_type.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/exception_type.hpp b/src/utils/exception_type.hpp index 0d9047e..a8e9d82 100644 --- a/src/utils/exception_type.hpp +++ b/src/utils/exception_type.hpp @@ -4,7 +4,7 @@ #include // libstdc++ and libc++ -#if defined(CPPTRACE_HAS_CXX_EXCEPTION_TYPE) && defined(__GLIBCXX__) || defined(__GLIBCPP__) || defined(_LIBCPP_VERSION) +#if defined(CPPTRACE_HAS_CXX_EXCEPTION_TYPE) && (defined(__GLIBCXX__) || defined(__GLIBCPP__) || defined(_LIBCPP_VERSION)) #include #endif @@ -13,7 +13,7 @@ namespace cpptrace { namespace detail { inline std::string exception_type_name() { - #if defined(CPPTRACE_HAS_CXX_EXCEPTION_TYPE) && defined(__GLIBCXX__) || defined(__GLIBCPP__) || defined(_LIBCPP_VERSION) + #if defined(CPPTRACE_HAS_CXX_EXCEPTION_TYPE) && (defined(__GLIBCXX__) || defined(__GLIBCPP__) || defined(_LIBCPP_VERSION)) const std::type_info* t = abi::__cxa_current_exception_type(); return t ? detail::demangle(t->name()) : ""; #else