Skip to content

Commit

Permalink
Disable forced inline when building in debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
reduz committed Oct 2, 2018
1 parent ff1794a commit 75c2987
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
8 changes: 8 additions & 0 deletions core/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 <class T>
T *_nullptr() {
Expand Down

0 comments on commit 75c2987

Please sign in to comment.