From 82b87d7a17c39617c7e84065250be77135077e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 3 Oct 2022 11:18:27 +0200 Subject: Remove unsupported `NO_SAFE_CAST`/`-fno-rtti` from Android build Android was the last platform to still attempt to disable RTTI (for binary size), but both the Android editor and now the ICU library used by templates need RTTI. There could still be the possibility to support this for non-ICU template builds (i.e. without the TextServerAdvanced module), but since this isn't one of the build configurations we test regularly it's pretty risky to keep this option only for that specific use case. And our code is already littered with `dynamic_cast`s which weren't guarded with `!defined(NO_SAFE_CAST)`. --- core/object/object.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'core/object') diff --git a/core/object/object.h b/core/object/object.h index 8ade5a204a..33a5afc9aa 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -733,34 +733,12 @@ public: template static T *cast_to(Object *p_object) { -#ifndef NO_SAFE_CAST return dynamic_cast(p_object); -#else - if (!p_object) { - return nullptr; - } - if (p_object->is_class_ptr(T::get_class_ptr_static())) { - return static_cast(p_object); - } else { - return nullptr; - } -#endif } template static const T *cast_to(const Object *p_object) { -#ifndef NO_SAFE_CAST return dynamic_cast(p_object); -#else - if (!p_object) { - return nullptr; - } - if (p_object->is_class_ptr(T::get_class_ptr_static())) { - return static_cast(p_object); - } else { - return nullptr; - } -#endif } enum { -- cgit v1.2.3