Add more assertions.
[tagua/yd.git] / src / common.cpp
blobd00ac7eb057c2edb1e8f03eedbc53dadd237ac7b
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 /**
15 * @brief Namespace holding Boost stubs.
17 namespace boost {
18 // throw exception: used by boost
19 void throw_exception(std::exception const &) {
20 kError() << "[bug] boost exception";
24 #ifdef Q_CC_GNU
25 #include <typeinfo>
26 #include <cxxabi.h>
27 #endif //Q_CC_GNU
29 QString prettyTypeName(const char* name) {
30 #ifdef Q_CC_GNU
31 int s;
32 const char* res = abi::__cxa_demangle(name, NULL, NULL, &s);
33 if(res) {
34 QString retv(res);
35 free((void*)res);
36 return retv;
38 #endif //Q_CC_GNU
39 return QString(name);