Skip to content

Commit

Permalink
Fix AXASSERT() not working with more complex msg arguments (#1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
smilediver authored Jan 12, 2024
1 parent 4a4b267 commit 5bcaa9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/base/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2011 Zynga Inc.
Copyright (c) 2013-2016 Chukong Technologies Inc.
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md).
https://axmolengine.github.io/
Expand Down Expand Up @@ -45,8 +46,9 @@ extern bool AX_DLL cc_assert_script_compatible(const char* msg);
{ \
if (!(cond)) \
{ \
if (msg && *msg && !cc_assert_script_compatible(msg)) \
ax::log("Assert failed: %s", msg); \
const char* m = (msg); \
if (m && *m && !cc_assert_script_compatible(m)) \
ax::log("Assert failed: %s", m); \
AX_ASSERT(cond); \
} \
} while (0)
Expand Down

0 comments on commit 5bcaa9c

Please sign in to comment.