Prepare 1.0 alpha3 release.
[tagua/yd.git] / src / common.cpp
blob1b0333d88913b4f64c0a84fc4ffdf996eaa82765
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #include "common.h"
12 #include <KDebug>
14 namespace boost {
15 // throw exception: used by boost
16 void throw_exception(std::exception const &) {
17 kError() << "[bug] boost exception";
21 #ifdef Q_CC_GNU
22 #include <typeinfo>
23 #include <cxxabi.h>
24 #endif //Q_CC_GNU
26 QString prettyTypeName(const char* name) {
27 #ifdef Q_CC_GNU
28 int s;
29 const char* res = abi::__cxa_demangle(name, NULL, NULL, &s);
30 if(res) {
31 QString retv(res);
32 free((void*)res);
33 return retv;
35 #endif //Q_CC_GNU
36 return QString(name);