blob: 4133ec333822a9f9363c6710ccdc68a43b1fdb34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef __TYPEINFO_H
#define __TYPEINFO_H
#include <typeinfo>
#include <string>
#include <stdexcept>
#ifdef __GNUG__
#include <cxxabi.h>
std::string demangle( const std::type_info &info )
{
enum { BUFLEN = 200 };
char buf[BUFLEN];
std::size_t buflen = BUFLEN;
int status;
__cxxabiv1::__cxa_demangle( info.name( ), buf, &buflen, &status );
if( status != 0 ) {
throw std::runtime_error( "__cxa_demangle failed!" );
}
return buf;
}
#else
#error "C++ demangling not ported!"
#endif
#endif
|