diff options
author | George Marques <george@gmarqu.es> | 2022-04-05 20:40:07 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2022-04-05 20:40:07 -0300 |
commit | 62ad18a3a16867aebc03243e26ce0363b4020238 (patch) | |
tree | d1da584206158bae0a4f697d6115d35df6310db0 /core/object/class_db.h | |
parent | e4f0fc50f79336cf76beec40e5e8e5164b288714 (diff) |
Remove argument name strings from release builds
They are not needed in release, so we can remove them to reduce the
binary size.
Diffstat (limited to 'core/object/class_db.h')
-rw-r--r-- | core/object/class_db.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/object/class_db.h b/core/object/class_db.h index 5da8523743..333a3307e2 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -45,6 +45,8 @@ #define DEFVAL(m_defval) (m_defval) +#ifdef DEBUG_METHODS_ENABLED + struct MethodDefinition { StringName name; Vector<StringName> args; @@ -70,6 +72,14 @@ MethodDefinition D_METHOD(const char *p_name, const char *p_arg1, const char *p_ MethodDefinition D_METHOD(const char *p_name, const char *p_arg1, const char *p_arg2, const char *p_arg3, const char *p_arg4, const char *p_arg5, const char *p_arg6, const char *p_arg7, const char *p_arg8, const char *p_arg9, const char *p_arg10, const char *p_arg11, const char *p_arg12); MethodDefinition D_METHOD(const char *p_name, const char *p_arg1, const char *p_arg2, const char *p_arg3, const char *p_arg4, const char *p_arg5, const char *p_arg6, const char *p_arg7, const char *p_arg8, const char *p_arg9, const char *p_arg10, const char *p_arg11, const char *p_arg12, const char *p_arg13); +#else + +// When DEBUG_METHODS_ENABLED is set this will let the engine know +// the argument names for easier debugging. +#define D_METHOD(m_c, ...) m_c + +#endif + class ClassDB { public: enum APIType { @@ -134,7 +144,11 @@ public: static HashMap<StringName, StringName> resource_base_extensions; static HashMap<StringName, StringName> compat_classes; +#ifdef DEBUG_METHODS_ENABLED static MethodBind *bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const MethodDefinition &method_name, const Variant **p_defs, int p_defcount); +#else + static MethodBind *bind_methodfi(uint32_t p_flags, MethodBind *p_bind, const char *method_name, const Variant **p_defs, int p_defcount); +#endif static APIType current_api; |