From 26479af70a3af001ebd13807998d2e797b7323d0 Mon Sep 17 00:00:00 2001 From: Walzer Date: Tue, 13 Jul 2010 06:21:06 +0000 Subject: [PATCH] issue #5, add NSAssert define --- cocos2dx/include/Cocos2dDefine.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cocos2dx/include/Cocos2dDefine.h b/cocos2dx/include/Cocos2dDefine.h index daf3bf754a..853c123713 100644 --- a/cocos2dx/include/Cocos2dDefine.h +++ b/cocos2dx/include/Cocos2dDefine.h @@ -84,5 +84,18 @@ THE SOFTWARE. #define CCX_SAFE_DELETE(p) if(p) {delete p; p=NULL;} #define CCX_BREAK_IF(cond) if(cond) break; +#ifdef _DEBUG +#include "assert.h" +#define NSAssert(_CONDITION, _TXT)\ + if(! (_CONDITION) ) \ + { \ + printf( (_TXT) ); \ + assert( (_CONDITION) ); \ + } +#else +#define NSAssert(_CONDITION, _TXT) +#endif + + #endif // __COCOS2D_DEFINE_H__