Commit 54863241 authored by Dmitri Shubin's avatar Dmitri Shubin

Solaris doesn't have backtrace()

parent 02172546
...@@ -28,7 +28,8 @@ ...@@ -28,7 +28,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <exception> #include <exception>
#ifndef __CYGWIN__ #if !defined(__CYGWIN__) && !defined(__sun)
#define KJ_HAS_BACKTRACE 1
#include <execinfo.h> #include <execinfo.h>
#endif #endif
...@@ -177,7 +178,7 @@ Exception::Exception(Nature nature, Durability durability, const char* file, int ...@@ -177,7 +178,7 @@ Exception::Exception(Nature nature, Durability durability, const char* file, int
String description) noexcept String description) noexcept
: file(file), line(line), nature(nature), durability(durability), : file(file), line(line), nature(nature), durability(durability),
description(mv(description)) { description(mv(description)) {
#ifdef __CYGWIN__ #ifndef KJ_HAS_BACKTRACE
traceCount = 0; traceCount = 0;
#else #else
traceCount = backtrace(trace, 16); traceCount = backtrace(trace, 16);
...@@ -188,7 +189,7 @@ Exception::Exception(Nature nature, Durability durability, String file, int line ...@@ -188,7 +189,7 @@ Exception::Exception(Nature nature, Durability durability, String file, int line
String description) noexcept String description) noexcept
: ownFile(kj::mv(file)), file(ownFile.cStr()), line(line), nature(nature), : ownFile(kj::mv(file)), file(ownFile.cStr()), line(line), nature(nature),
durability(durability), description(mv(description)) { durability(durability), description(mv(description)) {
#ifdef __CYGWIN__ #ifndef KJ_HAS_BACKTRACE
traceCount = 0; traceCount = 0;
#else #else
traceCount = backtrace(trace, 16); traceCount = backtrace(trace, 16);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment