Commit 1fcec985 authored by Kenton Varda's avatar Kenton Varda

Add missing includes, ifdef-out RTTI-requiring debug code when RTTI disabled.

parent 793b2af2
......@@ -26,7 +26,6 @@
#include "vector.h"
#include <exception>
#include <map>
#include <typeinfo>
#if KJ_USE_FUTEX
#include <unistd.h>
......@@ -34,8 +33,12 @@
#include <linux/futex.h>
#endif
#if !KJ_NO_RTTI
#include <typeinfo>
#if __GNUC__
#include <cxxabi.h>
#include <stdlib.h>
#endif
#endif
namespace kj {
......@@ -355,6 +358,7 @@ _::PromiseNode* Event::getInnerForTrace() {
return nullptr;
}
#if !KJ_NO_RTTI
#if __GNUC__
static kj::String demangleTypeName(const char* name) {
int status;
......@@ -368,8 +372,12 @@ static kj::String demangleTypeName(const char* name) {
return kj::heapString(name);
}
#endif
#endif
static kj::String traceImpl(Event* event, _::PromiseNode* node) {
#if KJ_NO_RTTI
return heapString("Trace not available because RTTI is disabled.");
#else
kj::Vector<kj::String> trace;
if (event != nullptr) {
......@@ -382,6 +390,7 @@ static kj::String traceImpl(Event* event, _::PromiseNode* node) {
}
return strArray(trace, "\n");
#endif
}
kj::String Event::trace() {
......
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