Projects > cpp > Issues > Refactor #879

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

use CCAssert() instead of assert()

Refactor #879 [Closed]
dumganhar 2011-11-27 22:14 . Updated almost 7 years ago

There are a lot of ‘assert()’ in cocos2d-x project. Because the bada platform doesn’t have system assert support and cocos2d-x owns the macro ‘CC_ASSERT’.

// assertion
#define CC_ASSERT(cond)                assert(cond)

#include "CCPlatformFunc_bada.h"
#ifdef _DEBUG
#define CC_ASSERT(cond)  (void)( (!!(cond)) || (badaAssert(__PRETTY_FUNCTION__ , __LINE__ , #cond))
#define CC_ASSERT(cond)  void(0)
#endif /* _DEBUG */

badaAssert function use the bada system messagebox to notify programmer that there is an assert appeared. If use assert directly, there are no assert notifications.

zhangxm 2011-11-28 18:14
  • Subject changed from use CC_ASSERT() instead of assert() to use CCAssert() instead of assert()
zhangxm 2011-11-29 18:23
  • Status changed from New to Resolved
zhangxm 2011-11-29 18:23
  • Status changed from Resolved to Closed 2012-05-25 08:03
  • Project changed from cocos2d-x to cpp
  • Category deleted (5)
  • Target version deleted (cocos2d-1.0.1-x-0.10.0)

Atom PDF

Start date:2011-11-27
Due date:
% Done:


Target version:-