diff options
author | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 12:56:03 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2014-12-06 12:56:03 +0000 |
commit | 9ce77cc16d4a8aeb72ec0dc925966e11c85a985e (patch) | |
tree | d95a96104d4be2fb9b42d406ec0db150601f8ceb /lib/common/Utils.cpp | |
parent | 5e0e3bb7a9d2767bb1ffdb392c742b616f97eb25 (diff) |
Fix compile on platforms without execinfo.h
Diffstat (limited to 'lib/common/Utils.cpp')
-rw-r--r-- | lib/common/Utils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/common/Utils.cpp b/lib/common/Utils.cpp index ddb79ba8..a73a80da 100644 --- a/lib/common/Utils.cpp +++ b/lib/common/Utils.cpp @@ -15,7 +15,7 @@ #include <cstdlib> -#ifdef SHOW_BACKTRACE_ON_EXCEPTION +#ifdef HAVE_EXECINFO_H #include <execinfo.h> #include <stdlib.h> #endif @@ -95,7 +95,6 @@ void SplitString(std::string String, char SplitOn, std::vector<std::string> &rOu #endif*/ } -#ifdef SHOW_BACKTRACE_ON_EXCEPTION static std::string demangle(const std::string& mangled_name) { std::string demangled_name = mangled_name; @@ -146,6 +145,7 @@ static std::string demangle(const std::string& mangled_name) void DumpStackBacktrace() { +#ifdef HAVE_EXECINFO_H void *array[20]; size_t size = backtrace(array, 20); BOX_TRACE("Obtained " << size << " stack frames."); @@ -182,8 +182,10 @@ void DumpStackBacktrace() BOX_TRACE(output.str()); } +#else // !HAVE_EXECINFO_H + BOX_TRACE("Backtrace support was not compiled in"); +#endif // HAVE_EXECINFO_H } -#endif // SHOW_BACKTRACE_ON_EXCEPTION |