mirror of https://github.com/axmolengine/axmol.git
issue #5, add NSAssert define
This commit is contained in:
parent
b5fcd6177d
commit
26479af70a
|
@ -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__
|
||||
|
||||
|
|
Loading…
Reference in New Issue