From 55fa2104d90cbe41e93189183c49608f736f4ac6 Mon Sep 17 00:00:00 2001 From: FishermanWWK Date: Mon, 1 Jun 2026 19:54:10 -0700 Subject: [PATCH] Fix missing namespaces in macros Changed some macros to use the full (`::godot::*`) namespace path to method calls and class names. --- include/godot_cpp/core/memory.hpp | 2 +- include/godot_cpp/templates/safe_refcount.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/godot_cpp/core/memory.hpp b/include/godot_cpp/core/memory.hpp index 9b367d9d8..4dbc0b634 100644 --- a/include/godot_cpp/core/memory.hpp +++ b/include/godot_cpp/core/memory.hpp @@ -148,7 +148,7 @@ class DefaultTypedAllocator { _ALWAYS_INLINE_ void delete_allocation(T *p_allocation) { memdelete(p_allocation); } }; -#define memnew_arr(m_class, m_count) memnew_arr_template(m_count) +#define memnew_arr(m_class, m_count) ::godot::memnew_arr_template(m_count) _FORCE_INLINE_ uint64_t *_get_element_count_ptr(uint8_t *p_ptr) { return (uint64_t *)(p_ptr - Memory::DATA_OFFSET + Memory::ELEMENT_OFFSET); diff --git a/include/godot_cpp/templates/safe_refcount.hpp b/include/godot_cpp/templates/safe_refcount.hpp index 42cdb2444..8dd97c306 100644 --- a/include/godot_cpp/templates/safe_refcount.hpp +++ b/include/godot_cpp/templates/safe_refcount.hpp @@ -48,13 +48,13 @@ namespace godot { // even with threads that are already running. // These are used in very specific areas of the engine where it's critical that these guarantees are held -#define SAFE_NUMERIC_TYPE_PUN_GUARANTEES(m_type) \ - static_assert(sizeof(SafeNumeric) == sizeof(m_type)); \ - static_assert(alignof(SafeNumeric) == alignof(m_type)); \ +#define SAFE_NUMERIC_TYPE_PUN_GUARANTEES(m_type) \ + static_assert(sizeof(::godot::SafeNumeric) == sizeof(m_type)); \ + static_assert(alignof(::godot::SafeNumeric) == alignof(m_type)); \ static_assert(std::is_trivially_destructible_v>); -#define SAFE_FLAG_TYPE_PUN_GUARANTEES \ - static_assert(sizeof(SafeFlag) == sizeof(bool)); \ - static_assert(alignof(SafeFlag) == alignof(bool)); +#define SAFE_FLAG_TYPE_PUN_GUARANTEES \ + static_assert(sizeof(::godot::SafeFlag) == sizeof(bool)); \ + static_assert(alignof(::godot::SafeFlag) == alignof(bool)); template class SafeNumeric {