C++: Fix vtable with libstdc++

__cxxabiv1 is an internal namespace used by GNU's libstdc++.
When linking with C++ standard library (libstdc++),
__cxxabiv1::__class_type_info is already defined inside.
If user code contains virtual classes,
__cxxabiv1::__class_type_info is defined twice.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
This commit is contained in:
Benoit Leforestier 2018-10-29 19:09:42 +01:00 committed by Anas Nashif
parent 0fe7a9864a
commit 16451850e7

View file

@ -14,6 +14,7 @@
* @brief basic virtual tables required for classes to build
*
*/
#if !defined(CONFIG_LIB_CPLUSPLUS)
namespace __cxxabiv1 {
class __class_type_info {
@ -25,3 +26,4 @@ namespace __cxxabiv1 {
void __class_type_info::dummy() { } // causes the vtable to get created here
void __si_class_type_info::dummy() { } // causes the vtable to get created here
};
#endif // !defined(CONFIG_LIB_CPLUSPLUS)