/* define if Guile has type scm_t_subr */
#define HAVE_GUILE_SUBR_TYPE 0
+
+/* define if cxxabi.h has workable demangler */
+
+#define HAVE_CXA_DEMANGLE 0
[#include <libguile.h>])
CXXFLAGS="$save_CXXFLAGS"
+## Check for usable cxxabi
+AC_MSG_CHECKING(for usable C++ demangler)
+AC_LINK_IFELSE([#include <cxxabi.h>
+int main(){
+ size_t sz;
+ int status;
+ char *ptr = abi::__cxa_demangle ("", 0, &sz, &status);
+ return 0;
+ }], [AC_DEFINE(HAVE_CXA_DEMANGLE)
+ AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT([no, use c++filt -t for manual demangling])])
+
## check rational bugfix.
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$GUILE_CFLAGS $CPPFLAGS"
#ifndef __YAFFUT_H__
#define __YAFFUT_H__
+#include "config.hh"
+#if HAVE_CXA_DEMANGLE
#include <cxxabi.h>
+#else
+#include <typeinfo>
+#endif
#include <cmath>
#include <cstring>
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);
name = name.substr (pos + 2);
}
return name;
+#else
+ return typeid (T).name ();
+#endif
}
struct ITest