From d914a206a11cc1011a45f00674b1e16988fae77f Mon Sep 17 00:00:00 2001 From: Juan Cespedes Date: Wed, 10 Nov 2004 00:15:33 +0100 Subject: Version: 0.3.36 * Fixed "--indent" option * Got rid of Debian and RedHat specific parts in tarball --- demangle.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'demangle.c') diff --git a/demangle.c b/demangle.c index 73fbf06..63b7da6 100644 --- a/demangle.c +++ b/demangle.c @@ -2,8 +2,6 @@ #include "config.h" #endif -#if HAVE_LIBIBERTY - #include #include #include @@ -14,6 +12,8 @@ #include "dict.h" +#ifdef USE_DEMANGLE + /*****************************************************************************/ static struct dict * d = NULL; @@ -27,6 +27,10 @@ my_demangle_dict_clear(void) { const char * my_demangle(const char * function_name) { const char * tmp, * fn_copy; +#if !defined HAVE_LIBIBERTY && defined HAVE_LIBSUPC__ + extern char *__cxa_demangle (const char *, char *, size_t *, int *); + int status = 0; +#endif if (!d) { d = dict_init(dict_key2hash_string, dict_key_cmp_string); @@ -36,7 +40,11 @@ my_demangle(const char * function_name) { tmp = dict_find_entry(d, (void *)function_name); if (!tmp) { fn_copy = strdup(function_name); - tmp = cplus_demangle(function_name+strspn(function_name, "_"), DMGL_ANSI | DMGL_PARAMS); +#ifdef HAVE_LIBIBERTY + tmp = cplus_demangle(function_name, DMGL_ANSI | DMGL_PARAMS); +#elif defined HAVE_LIBSUPC__ + tmp = __cxa_demangle(function_name, NULL, NULL, &status); +#endif if (!tmp) tmp = fn_copy; if (tmp) dict_enter(d, (void *)fn_copy, (void *)tmp); } -- cgit v1.2.3