From 07fdd2374e27ae02621dadf4196242ce75f993cd Mon Sep 17 00:00:00 2001 From: daniellopez2002 <89090856+daniellopez2002@users.noreply.github.com> Date: Wed, 28 Jan 2026 17:09:01 -0500 Subject: [PATCH 1/2] Fix VARIANT_ENUM_CAST to support enum class --- include/godot_cpp/core/binder_common.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/godot_cpp/core/binder_common.hpp b/include/godot_cpp/core/binder_common.hpp index 61eb6a04d..2b93f871d 100644 --- a/include/godot_cpp/core/binder_common.hpp +++ b/include/godot_cpp/core/binder_common.hpp @@ -56,7 +56,7 @@ namespace godot { } \ typedef int64_t EncodeT; \ _FORCE_INLINE_ static void encode(m_enum p_val, void *p_ptr) { \ - *reinterpret_cast(p_ptr) = p_val; \ + *reinterpret_cast(p_ptr) = static_cast(p_val); \ } \ }; \ } @@ -77,7 +77,7 @@ namespace godot { } \ typedef int64_t EncodeT; \ _FORCE_INLINE_ static void encode(BitField p_val, void *p_ptr) { \ - *reinterpret_cast(p_ptr) = p_val; \ + *reinterpret_cast(p_ptr) = static_cast(p_val); \ } \ }; \ } From 2fbceba4f9f0be5af9eff4d14c1ea90758296291 Mon Sep 17 00:00:00 2001 From: daniellopez2002 <89090856+daniellopez2002@users.noreply.github.com> Date: Thu, 29 Jan 2026 00:20:40 -0500 Subject: [PATCH 2/2] Format VARIANT_ENUM_CAST macro --- include/godot_cpp/core/binder_common.hpp | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/include/godot_cpp/core/binder_common.hpp b/include/godot_cpp/core/binder_common.hpp index 2b93f871d..6b7c6dd40 100644 --- a/include/godot_cpp/core/binder_common.hpp +++ b/include/godot_cpp/core/binder_common.hpp @@ -40,25 +40,25 @@ namespace godot { -#define VARIANT_ENUM_CAST(m_enum) \ - namespace godot { \ - MAKE_ENUM_TYPE_INFO(m_enum) \ - template <> \ - struct VariantCaster { \ - static _FORCE_INLINE_ m_enum cast(const Variant &p_variant) { \ - return (m_enum)p_variant.operator int64_t(); \ - } \ - }; \ - template <> \ - struct PtrToArg { \ - _FORCE_INLINE_ static m_enum convert(const void *p_ptr) { \ - return m_enum(*reinterpret_cast(p_ptr)); \ - } \ - typedef int64_t EncodeT; \ - _FORCE_INLINE_ static void encode(m_enum p_val, void *p_ptr) { \ - *reinterpret_cast(p_ptr) = static_cast(p_val); \ - } \ - }; \ +#define VARIANT_ENUM_CAST(m_enum) \ + namespace godot { \ + MAKE_ENUM_TYPE_INFO(m_enum) \ + template <> \ + struct VariantCaster { \ + static _FORCE_INLINE_ m_enum cast(const Variant &p_variant) { \ + return (m_enum)p_variant.operator int64_t(); \ + } \ + }; \ + template <> \ + struct PtrToArg { \ + _FORCE_INLINE_ static m_enum convert(const void *p_ptr) { \ + return m_enum(*reinterpret_cast(p_ptr)); \ + } \ + typedef int64_t EncodeT; \ + _FORCE_INLINE_ static void encode(m_enum p_val, void *p_ptr) { \ + *reinterpret_cast(p_ptr) = static_cast(p_val); \ + } \ + }; \ } #define VARIANT_BITFIELD_CAST(m_enum) \