recastnavigation / recastnavigation

Industry-standard navigation-mesh toolset for games

Home Page:http://recastnav.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for non-standard Assert-enabling macro

grahamboree opened this issue · comments

Currently rcAssert is disabled if NDEBUG is defined. It's often useful, however, to have non-debug builds that have asserts enabled.

To allow for this kind of flexibility in usage, rcAssert should be defined based on a Recast-specific preprocessor declaration, rather than a standardized one like this. Something like RC_ENABLE_ASSERTS

#ifdef NDEBUG
// From http://cnicholson.net/2009/02/stupid-c-tricks-adventures-in-assert/
# define rcAssert(x) do { (void)sizeof(x); } while((void)(__LINE__==-1),false)
#else