diff --git a/CMakeLists.txt b/CMakeLists.txt index ccb32cb188..cbfbfb1c21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,7 +168,7 @@ add_library(${PROJECT_NAME} add_library(godot::cpp ALIAS ${PROJECT_NAME}) target_compile_definitions(${PROJECT_NAME} PUBLIC $<$:DEBUG_ENABLED> - $<$:DEV_ENABLED> + $<$:DEBUG_METHODS_ENABLED> ) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") diff --git a/include/godot_cpp/core/binder_common.hpp b/include/godot_cpp/core/binder_common.hpp index 22a2ff8692..93ed731f4a 100644 --- a/include/godot_cpp/core/binder_common.hpp +++ b/include/godot_cpp/core/binder_common.hpp @@ -212,7 +212,7 @@ template void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED (p_instance->*p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else (p_instance->*p_method)(VariantCaster

::cast(*p_args[Is])...); @@ -224,7 +224,7 @@ template void call_with_variant_argsc_helper(T *p_instance, void (T::*p_method)(P...) const, const Variant **p_args, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED (p_instance->*p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else (p_instance->*p_method)(VariantCaster

::cast(*p_args[Is])...); @@ -236,7 +236,7 @@ template void call_with_variant_args_ret_helper(T *p_instance, R (T::*p_method)(P...), const Variant **p_args, Variant &r_ret, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED r_ret = (p_instance->*p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else r_ret = (p_instance->*p_method)(VariantCaster

::cast(*p_args[Is])...); @@ -247,7 +247,7 @@ template void call_with_variant_args_retc_helper(T *p_instance, R (T::*p_method)(P...) const, const Variant **p_args, Variant &r_ret, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED r_ret = (p_instance->*p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else r_ret = (p_instance->*p_method)(VariantCaster

::cast(*p_args[Is])...); @@ -397,7 +397,7 @@ void call_with_variant_args_retc_dv(T *p_instance, R (T::*p_method)(P...) const, // GCC raises "parameter 'p_args' set but not used" when P = {}, // it's not clever enough to treat other P values as making this branch valid. -#if defined(DEV_ENABLED) && defined(__GNUC__) && !defined(__clang__) +#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-but-set-parameter" #endif @@ -465,7 +465,7 @@ template void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_args, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED (p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else (p_method)(VariantCaster

::cast(*p_args[Is])...); @@ -521,7 +521,7 @@ template void call_with_variant_args_static_ret(R (*p_method)(P...), const Variant **p_args, Variant &r_ret, GDNativeCallError &r_error, IndexSequence) { r_error.error = GDNATIVE_CALL_OK; -#ifdef DEV_ENABLED +#ifdef DEBUG_METHODS_ENABLED r_ret = (p_method)(VariantCasterAndValidate

::cast(p_args, Is, r_error)...); #else r_ret = (p_method)(VariantCaster

::cast(*p_args[Is])...); diff --git a/tools/targets.py b/tools/targets.py index df63768dee..6e19931e16 100644 --- a/tools/targets.py +++ b/tools/targets.py @@ -30,7 +30,7 @@ def generate(env): env.AppendUnique(CPPDEFINES=["TOOLS_ENABLED"]) if env.debug_features: - env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED"]) + env.AppendUnique(CPPDEFINES=["DEBUG_ENABLED", "DEBUG_METHODS_ENABLED"]) if env.dev_build: opt_level = "none"