summaryrefslogtreecommitdiff
path: root/core/variant
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-10-07 15:18:52 -0300
committerGeorge Marques <george@gmarqu.es>2021-10-07 16:13:44 -0300
commitfafa8c7f6e9dea6dfcfd827d9e2a8632bea7b335 (patch)
treeeba1a5002d2fefd54b6447cda099f4b9fcaf8b87 /core/variant
parent082f624ef4b391976575ff8dfc7ad125bdb25a9d (diff)
Enable method type information on release builds
This is needed to ensure GDScript compilation works properly on release builds and make use of optimized typed instructions.
Diffstat (limited to 'core/variant')
-rw-r--r--core/variant/binder_common.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h
index 3b2c837096..8592a1dc62 100644
--- a/core/variant/binder_common.h
+++ b/core/variant/binder_common.h
@@ -563,13 +563,11 @@ void call_with_validated_variant_args_static_method_ret(R (*p_method)(P...), con
// 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(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
#endif
-#ifdef DEBUG_METHODS_ENABLED
-
template <class Q>
void call_get_argument_type_helper(int p_arg, int &index, Variant::Type &type) {
if (p_arg == index) {
@@ -608,6 +606,7 @@ void call_get_argument_type_info(int p_arg, PropertyInfo &info) {
(void)index; // Suppress GCC warning.
}
+#ifdef DEBUG_METHODS_ENABLED
template <class Q>
void call_get_argument_metadata_helper(int p_arg, int &index, GodotTypeInfo::Metadata &md) {
if (p_arg == index) {
@@ -629,13 +628,6 @@ GodotTypeInfo::Metadata call_get_argument_metadata(int p_arg) {
return md;
}
-#else
-
-template <class... P>
-Variant::Type call_get_argument_type(int p_arg) {
- return Variant::NIL;
-}
-
#endif // DEBUG_METHODS_ENABLED
//////////////////////
@@ -915,7 +907,7 @@ void call_with_variant_args_static_dv(void (*p_method)(P...), const Variant **p_
call_with_variant_args_static(p_method, args, r_error, BuildIndexSequence<sizeof...(P)>{});
}
-#if defined(DEBUG_METHODS_ENABLED) && defined(__GNUC__) && !defined(__clang__)
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif