usb: getting string descriptors, minor improvements
[quarnos.git] / manes / rtti.cpp
blob4d4ec28b7442bddb20c0cdaf796fbe83f667181e
1 /* Quarn OS
3 * RTTI support
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "typeinfo"
25 __cxxabiv1::__fundamental_type_info::~__fundamental_type_info() {}
27 __cxxabiv1::__class_type_info::~__class_type_info() {}
29 bool __cxxabiv1::__class_type_info::__do_upcast(const __cxxabiv1::__class_type_info *info, void **) const {
30 return *this == *info;
33 __cxxabiv1::__si_class_type_info::~__si_class_type_info() {}
35 bool __cxxabiv1::__si_class_type_info::__do_upcast(const __cxxabiv1::__class_type_info *info, void **obj) const {
36 if (__class_type_info::__do_upcast(info, obj))
37 return true;
39 return __base_type->__do_upcast(info, obj);
42 __cxxabiv1::__vmi_class_type_info::~__vmi_class_type_info() {}
44 bool __cxxabiv1::__vmi_class_type_info::__do_upcast(const __cxxabiv1::__class_type_info *info, void **obj) const {
45 if (__class_type_info::__do_upcast(info, obj))
46 return true;
48 for (unsigned int i = 0; i < __base_count; i++) {
49 if (__base_info[i].__base_type->__do_upcast(info, obj)) {
50 *obj = (void*)((unsigned int)*obj + (__base_info[i].__offset_flags >> 8));
51 return true;
55 return false;
58 __cxxabiv1::__pbase_type_info::~__pbase_type_info() {}
60 bool __cxxabiv1::__pbase_type_info::__do_upcast(const __cxxabiv1::__class_type_info *dst, void **) const {
61 /* ??? */
62 return false; //__pointee->__do_upcast(dst, 0);
65 bool __cxxabiv1::__pbase_type_info::__is_pointer_p() const {
66 return true;
70 __cxxabiv1::__pointer_type_info::~__pointer_type_info() {}
72 std::type_info::~type_info() {}
74 bool std::type_info::__is_pointer_p() const {
75 return false;
78 bool std::type_info::__is_function_p() const {
79 return false;
82 bool std::type_info::__do_catch(const type_info *, void **, unsigned int) const {
83 return false;
86 bool std::type_info::__do_upcast(const __cxxabiv1::__class_type_info *, void **) const {
87 return false;
90 extern "C" std::type_info const &__cxa_bad_typeid () {
91 return typeid (void);