issue #5, add NSAssert define

This commit is contained in:
Walzer 2010-07-13 06:21:06 +00:00
parent b5fcd6177d
commit 26479af70a
1 changed files with 13 additions and 0 deletions

View File

@ -84,5 +84,18 @@ THE SOFTWARE.
#define CCX_SAFE_DELETE(p) if(p) {delete p; p=NULL;} #define CCX_SAFE_DELETE(p) if(p) {delete p; p=NULL;}
#define CCX_BREAK_IF(cond) if(cond) break; #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__ #endif // __COCOS2D_DEFINE_H__