#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
-#if HAVE_DLFCN_H && __GNUG__
+#if HAVE_CXXABI_H
+#include cxxabi.h>
+#endif
+#if HAVE_DLFCN_H
#include <dlfcn.h>
-#include <cxxabi.h>
#endif
#if HAVE_MACH_MACH_H
#include <mach/mach.h>
if (dlinfo.dli_sname != NULL) {
int res;
fputc(' ', FD);
+# if HAVE_CXXABI_H
char* d = abi::__cxa_demangle(dlinfo.dli_sname, NULL, NULL, &res);
+# else
+ char* d = NULL;
+# endif
if (d == NULL) fputs(dlinfo.dli_sname, FD);
else fputs(d, FD);
free(d);