diff options
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/class_db.h | 20 | ||||
-rw-r--r-- | core/object/message_queue.cpp | 12 | ||||
-rw-r--r-- | core/object/object.cpp | 1 |
3 files changed, 17 insertions, 16 deletions
diff --git a/core/object/class_db.h b/core/object/class_db.h index 7a4ee1afa4..21243230de 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -188,7 +188,7 @@ public: template <class T> static void register_class(bool p_virtual = false) { GLOBAL_LOCK_FUNCTION; - static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS."); + static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS."); T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_NULL(t); @@ -203,7 +203,7 @@ public: template <class T> static void register_abstract_class() { GLOBAL_LOCK_FUNCTION; - static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS."); + static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS."); T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_NULL(t); @@ -216,7 +216,7 @@ public: template <class T> static void register_internal_class() { GLOBAL_LOCK_FUNCTION; - static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS."); + static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS."); T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_NULL(t); @@ -239,7 +239,7 @@ public: template <class T> static void register_custom_instance_class() { GLOBAL_LOCK_FUNCTION; - static_assert(TypesAreSame<typename T::self_type, T>::value, "Class not declared properly, please use GDCLASS."); + static_assert(types_are_same_v<typename T::self_type, T>, "Class not declared properly, please use GDCLASS."); T::initialize_class(); ClassInfo *t = classes.getptr(T::get_class_static()); ERR_FAIL_NULL(t); @@ -296,7 +296,7 @@ public: argptrs[i] = &args[i]; } MethodBind *bind = create_method_bind(p_method); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); @@ -311,7 +311,7 @@ public: } MethodBind *bind = create_static_method_bind(p_method); bind->set_instance_class(p_class); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, false, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); @@ -325,7 +325,7 @@ public: argptrs[i] = &args[i]; } MethodBind *bind = create_method_bind(p_method); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); @@ -340,7 +340,7 @@ public: } MethodBind *bind = create_static_method_bind(p_method); bind->set_instance_class(p_class); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return bind_methodfi(METHOD_FLAGS_DEFAULT, bind, true, p_method_name, sizeof...(p_args) == 0 ? nullptr : (const Variant **)argptrs, sizeof...(p_args)); @@ -353,7 +353,7 @@ public: MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant); ERR_FAIL_NULL_V(bind, nullptr); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return _bind_vararg_method(bind, p_name, p_default_args, false); @@ -366,7 +366,7 @@ public: MethodBind *bind = create_vararg_method_bind(p_method, p_info, p_return_nil_is_variant); ERR_FAIL_NULL_V(bind, nullptr); - if constexpr (std::is_same<typename member_function_traits<M>::return_type, Object *>::value) { + if constexpr (std::is_same_v<typename member_function_traits<M>::return_type, Object *>) { bind->set_return_type_is_raw_object_ptr(true); } return _bind_vararg_method(bind, p_name, p_default_args, true); diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index a394c957d0..83a19554dc 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -40,12 +40,12 @@ #ifdef DEV_ENABLED // Includes safety checks to ensure that a queue set as a thread singleton override // is only ever called from the thread it was set for. -#define LOCK_MUTEX \ - if (this != MessageQueue::thread_singleton) { \ - DEV_ASSERT(!this->is_current_thread_override); \ - mutex.lock(); \ - } else { \ - DEV_ASSERT(this->is_current_thread_override); \ +#define LOCK_MUTEX \ + if (this != MessageQueue::thread_singleton) { \ + DEV_ASSERT(!is_current_thread_override); \ + mutex.lock(); \ + } else { \ + DEV_ASSERT(is_current_thread_override); \ } #else #define LOCK_MUTEX \ diff --git a/core/object/object.cpp b/core/object/object.cpp index 3901c4835d..cc33d0ab8a 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1683,6 +1683,7 @@ void Object::_bind_methods() { BIND_CONSTANT(NOTIFICATION_POSTINITIALIZE); BIND_CONSTANT(NOTIFICATION_PREDELETE); + BIND_CONSTANT(NOTIFICATION_EXTENSION_RELOADED); BIND_ENUM_CONSTANT(CONNECT_DEFERRED); BIND_ENUM_CONSTANT(CONNECT_PERSIST); |