Don't use RTTI features when building with -fno-rtti

This should make it possible to use `-fno-rtti` in a C++ application even when Panda has been compiled with RTTI enabled.
This commit is contained in:
rdb 2023-05-25 14:11:51 +02:00
parent d2e93cc185
commit b79d8efce6
3 changed files with 4 additions and 4 deletions

View File

@ -213,7 +213,7 @@ NodeRefCountObj(const Base &copy) : Base(copy) {
template<class Base>
void NodeRefCountObj<Base>::
init_type() {
#if defined(HAVE_RTTI) && !defined(__EDG__)
#if defined(HAVE_RTTI) && !defined(__EDG__) && (!defined(__GNUC__) || defined(__GXX_RTTI))
// If we have RTTI, we can determine the name of the base type.
std::string base_name = typeid(Base).name();
#else

View File

@ -424,7 +424,7 @@ RefCountObj(const Base &copy) : Base(copy) {
template<class Base>
void RefCountObj<Base>::
init_type() {
#if defined(HAVE_RTTI) && !defined(__EDG__)
#if defined(HAVE_RTTI) && !defined(__EDG__) && (!defined(__GNUC__) || defined(__GXX_RTTI))
// If we have RTTI, we can determine the name of the base type.
std::string base_name = typeid(Base).name();
#else

View File

@ -128,7 +128,7 @@ make_cow_copy() {
template<class Base>
void CopyOnWriteObj<Base>::
init_type() {
#if defined(HAVE_RTTI) && !defined(__EDG__)
#if defined(HAVE_RTTI) && !defined(__EDG__) && (!defined(__GNUC__) || defined(__GXX_RTTI))
// If we have RTTI, we can determine the name of the base type.
std::string base_name = typeid(Base).name();
#else
@ -188,7 +188,7 @@ make_cow_copy() {
template<class Base, class Param1>
void CopyOnWriteObj1<Base, Param1>::
init_type() {
#if defined(HAVE_RTTI) && !defined(__EDG__)
#if defined(HAVE_RTTI) && !defined(__EDG__) && (!defined(__GNUC__) || defined(__GXX_RTTI))
// If we have RTTI, we can determine the name of the base type.
std::string base_name = typeid(Base).name();
#else