From 75c29879b0c0b100415b2abd1992994656d06aec Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 2 Oct 2018 13:53:53 -0300 Subject: [PATCH] Disable forced inline when building in debug. --- SConstruct | 3 ++- core/typedefs.h | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index a056a0c3ae7..1898e0b5d3b 100644 --- a/SConstruct +++ b/SConstruct @@ -234,7 +234,8 @@ env_base.platform_exporters = platform_exporters env_base.platform_apis = platform_apis if (env_base['target'] == 'debug'): - env_base.Append(CPPDEFINES=['DEBUG_MEMORY_ALLOC']) + env_base.Append(CPPDEFINES=['DEBUG_MEMORY_ALLOC','DISABLE_FORCED_INLINE']) + if (env_base['no_editor_splash']): env_base.Append(CPPDEFINES=['NO_EDITOR_SPLASH']) diff --git a/core/typedefs.h b/core/typedefs.h index 2b26bf08f70..5c15da9c2d8 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -44,6 +44,7 @@ #define _MKSTR(m_x) _STR(m_x) #endif +//should always inline no matter what #ifndef _ALWAYS_INLINE_ #if defined(__GNUC__) && (__GNUC__ >= 4) @@ -58,10 +59,17 @@ #endif +//should always inline, except in some cases because it makes debugging harder #ifndef _FORCE_INLINE_ + +#ifdef DISABLE_FORCED_INLINE +#define _FORCE_INLINE_ inline +#else #define _FORCE_INLINE_ _ALWAYS_INLINE_ #endif +#endif + //custom, gcc-safe offsetof, because gcc complains a lot. template T *_nullptr() {