Skip to content

Commit

Permalink
Revert "[SCons] Rename DEBUG_METHODS_ENABLED to DEV_ENABLED."
Browse files Browse the repository at this point in the history
This reverts commit a3b13c8.
  • Loading branch information
Faless committed Sep 25, 2022
1 parent 42d671b commit de29a38
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ add_library(${PROJECT_NAME}
add_library(godot::cpp ALIAS ${PROJECT_NAME})
target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<CONFIG:Debug>:DEBUG_ENABLED>
$<$<CONFIG:Debug>:DEV_ENABLED>
$<$<CONFIG:Debug>:DEBUG_METHODS_ENABLED>
)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
Expand Down
14 changes: 7 additions & 7 deletions include/godot_cpp/core/binder_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ template <class T, class... P, size_t... Is>
void call_with_variant_args_helper(T *p_instance, void (T::*p_method)(P...), const Variant **p_args, GDNativeCallError &r_error, IndexSequence<Is...>) {
r_error.error = GDNATIVE_CALL_OK;

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

#ifdef DEV_ENABLED
#ifdef DEBUG_METHODS_ENABLED
(p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
(p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
Expand All @@ -236,7 +236,7 @@ template <class T, class R, class... P, size_t... Is>
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<Is...>) {
r_error.error = GDNATIVE_CALL_OK;

#ifdef DEV_ENABLED
#ifdef DEBUG_METHODS_ENABLED
r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
Expand All @@ -247,7 +247,7 @@ template <class T, class R, class... P, size_t... Is>
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<Is...>) {
r_error.error = GDNATIVE_CALL_OK;

#ifdef DEV_ENABLED
#ifdef DEBUG_METHODS_ENABLED
r_ret = (p_instance->*p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_instance->*p_method)(VariantCaster<P>::cast(*p_args[Is])...);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -465,7 +465,7 @@ template <class... P, size_t... Is>
void call_with_variant_args_static(void (*p_method)(P...), const Variant **p_args, GDNativeCallError &r_error, IndexSequence<Is...>) {
r_error.error = GDNATIVE_CALL_OK;

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

#ifdef DEV_ENABLED
#ifdef DEBUG_METHODS_ENABLED
r_ret = (p_method)(VariantCasterAndValidate<P>::cast(p_args, Is, r_error)...);
#else
r_ret = (p_method)(VariantCaster<P>::cast(*p_args[Is])...);
Expand Down
2 changes: 1 addition & 1 deletion tools/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit de29a38

Please sign in to comment.