Skip to content

Commit

Permalink
Fix preprocessor checks
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 27, 2024
1 parent 17c2552 commit 7488213
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/2d/AnchoredSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ AnchoredSprite* AnchoredSprite::createWithSpriteFrameName(std::string_view sprit
{
SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);

#if _AX_DEBUG > 0
#if defined(_AX_DEBUG) && _AX_DEBUG > 0
char msg[256] = {0};
snprintf(msg, sizeof(msg), "Invalid spriteFrameName: %s", spriteFrameName.data());
AXASSERT(frame != nullptr, msg);
Expand Down
2 changes: 1 addition & 1 deletion core/2d/FontFNT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ void BMFontConfiguration::parseCommonArguments(const char* line)
auto tmp = strstr(line, "lineHeight=") + 11;
sscanf(tmp, "%d", &_commonHeight);

#if _AX_DEBUG > 0
#if defined(_AX_DEBUG) && _AX_DEBUG > 0
// scaleW. sanity check
int value;
tmp = strstr(tmp, "scaleW=") + 7;
Expand Down
2 changes: 1 addition & 1 deletion core/2d/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Sprite* Sprite::createWithSpriteFrameName(std::string_view spriteFrameName)
{
SpriteFrame* frame = SpriteFrameCache::getInstance()->getSpriteFrameByName(spriteFrameName);

#if _AX_DEBUG > 0
#if defined(_AX_DEBUG) && _AX_DEBUG > 0
char msg[256] = {0};
snprintf(msg, sizeof(msg), "Invalid spriteFrameName: %s", spriteFrameName.data());
AXASSERT(frame != nullptr, msg);
Expand Down
2 changes: 1 addition & 1 deletion core/base/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ bool Configuration::init()
_valueDict["axmol.compiled_with_gl_state_cache"] = Value(true);
#endif

#if _AX_DEBUG
#if defined(_AX_DEBUG) && _AX_DEBUG
_valueDict["axmol.build_type"] = Value("DEBUG");
#else
_valueDict["axmol.build_type"] = Value("RELEASE");
Expand Down
2 changes: 1 addition & 1 deletion core/base/Director.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ void Director::calculateDeltaTime()
_deltaTime = MAX(0, _deltaTime);
}

#if _AX_DEBUG
#if defined(_AX_DEBUG) && _AX_DEBUG
// If we are debugging our code, prevent big delta time
if (_deltaTime > 0.2f)
{
Expand Down
2 changes: 1 addition & 1 deletion core/base/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ THE SOFTWARE.
#include "platform/StdC.h"

#ifndef AXASSERT
# if _AX_DEBUG > 0
# if defined(_AX_DEBUG) && _AX_DEBUG > 0
# if AX_ENABLE_SCRIPT_BINDING
extern bool AX_DLL ax_assert_script_compatible(const char* msg);
# define AXASSERT(cond, msg) \
Expand Down
2 changes: 1 addition & 1 deletion core/base/ZipUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ int ZipUtils::inflateCCZBuffer(const unsigned char* buffer, ssize_t bufferLen, u

decodeEncodedPvr(ints, enclen);

#if _AX_DEBUG > 0
#if defined(_AX_DEBUG) && _AX_DEBUG > 0
// verify checksum in debug mode
unsigned int calculated = checksumPvr(ints, enclen);
unsigned int required = AX_SWAP_INT32_BIG_TO_HOST(header->reserved);
Expand Down

0 comments on commit 7488213

Please sign in to comment.