]> git.tdb.fi Git - libs/core.git/blob - source/debug/demangle.cpp
Don't throw on win32 if file has no owner or group
[libs/core.git] / source / debug / demangle.cpp
1 #include <cstdlib>
2 #ifdef __GNUC__
3 #include <cxxabi.h>
4 #endif
5 #include "demangle.h"
6
7 using namespace std;
8
9 namespace Msp {
10 namespace Debug {
11
12 string demangle(const string &sym)
13 {
14 #ifdef __GNUC__
15         int status;
16         char *dm = abi::__cxa_demangle(sym.c_str(), 0, 0, &status);
17         
18         string result;
19         if(status==0)
20                 result = dm;
21         else
22                 result = sym;
23         
24         free(dm);
25
26         return result;
27 #else
28         return sym;
29 #endif
30 }
31
32 } // namespace Debug
33 } // namespace Msp