war on -Werror, part 9: static inline > macros.

At least, according to the new wisdom of today.
This commit is contained in:
Jason Felds
2012-12-27 11:00:06 -05:00
parent e01537405f
commit d080c38196
+14 -2
View File
@@ -125,8 +125,20 @@ void NORETURN sm_crash( const char *reason = "Internal error" );
* This should probably be used instead of throwing an exception in most
* cases we expect never to happen (but not in cases that we do expect,
* such as DSound init failure.) */
#define FAIL_M(MESSAGE) do { CHECKPOINT_M(MESSAGE); sm_crash(MESSAGE); } while(0)
#define ASSERT_M(COND, MESSAGE) do { if(unlikely(!(COND))) { FAIL_M(MESSAGE); } } while(0)
static inline void FAIL_M(const char * MESSAGE)
{
CHECKPOINT_M(MESSAGE);
sm_crash(MESSAGE);
}
static inline void ASSERT_M(bool COND, const char * MESSAGE)
{
if (unlikely(!(COND)))
{
FAIL_M(MESSAGE);
}
}
#if !defined(CO_EXIST_WITH_MFC)
#define ASSERT(COND) ASSERT_M((COND), "Assertion '" #COND "' failed")
#endif