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
This commit is contained in:
parent
d2b940ab07
commit
a70cf7935a
@ -4,7 +4,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// libstdc++ and libc++
|
// 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 <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
namespace cpptrace {
|
namespace cpptrace {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
inline std::string exception_type_name() {
|
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();
|
const std::type_info* t = abi::__cxa_current_exception_type();
|
||||||
return t ? detail::demangle(t->name()) : "<unknown>";
|
return t ? detail::demangle(t->name()) : "<unknown>";
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user