summaryrefslogtreecommitdiff
path: root/flower
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2011-11-10 13:16:48 +0100
committerDavid Kastrup <dak@gnu.org>2011-11-11 14:16:48 +0100
commitbe9de62c7e951ea7e7cfc932466a40370909bf2d (patch)
tree1b4ad13b946f03649183066ef8232181865cca35 /flower
parentcd229915fc873fdb6fd0125827452cb0ba0067a7 (diff)
Don't let yaffut try to demangle when autoconf figures this won't work
Diffstat (limited to 'flower')
-rw-r--r--flower/include/yaffut.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/flower/include/yaffut.hh b/flower/include/yaffut.hh
index 376c036ed1..cf444626d9 100644
--- a/flower/include/yaffut.hh
+++ b/flower/include/yaffut.hh
@@ -6,7 +6,12 @@
#ifndef __YAFFUT_H__
#define __YAFFUT_H__
+#include "config.hh"
+#if HAVE_CXA_DEMANGLE
#include <cxxabi.h>
+#else
+#include <typeinfo>
+#endif
#include <cmath>
#include <cstring>
@@ -65,6 +70,7 @@ namespace yaffut
template <typename T>
std::string demangle ()
{
+#if HAVE_CXA_DEMANGLE
size_t sz;
int status;
char *ptr = abi::__cxa_demangle (typeid (T).name (), 0, &sz, &status);
@@ -76,6 +82,9 @@ std::string demangle ()
name = name.substr (pos + 2);
}
return name;
+#else
+ return typeid (T).name ();
+#endif
}
struct ITest