From 272bbe70e46729243e7e0d4644d80f9a12f6f875 Mon Sep 17 00:00:00 2001 From: wysaid Date: Tue, 4 Jun 2024 10:26:19 +0800 Subject: [PATCH] fix `assert` not found error --- .../src/main/jni/cge/common/cgeCommonDefine.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/library/src/main/jni/cge/common/cgeCommonDefine.h b/library/src/main/jni/cge/common/cgeCommonDefine.h index 578ae56d..d94e4d35 100644 --- a/library/src/main/jni/cge/common/cgeCommonDefine.h +++ b/library/src/main/jni/cge/common/cgeCommonDefine.h @@ -98,6 +98,18 @@ #endif #endif +#ifndef CGE_ASSERT +#ifdef DEBUG +#include +#define CGE_ASSERT(...) assert(__VA_ARGS__) +#else +#define CGE_ASSERT(...) +#ifndef assert +#define assert(...) +#endif +#endif +#endif + #define CGE_COMMON_CREATE_FUNC(cls, funcName) \ static inline cls* create() \ { \ @@ -316,7 +328,7 @@ typedef enum CGEGlobalBlendMode CGEGLOBAL_BLEND_ALPHA_SEPERATE, CGEGLOBAL_BLEND_ADD, CGEGLOBAL_BLEND_ADD_SEPARATE, - CGEGLOBAL_BLEND_ADD_SEPARATE_EXT, //带EXT的忽略alpha是否预乘 + CGEGLOBAL_BLEND_ADD_SEPARATE_EXT, // 带EXT的忽略alpha是否预乘 CGEGLOBAL_BLEND_MULTIPLY, CGEGLOBAL_BLEND_MULTIPLY_SEPERATE, CGEGLOBAL_BLEND_SCREEN, @@ -325,7 +337,7 @@ typedef enum CGEGlobalBlendMode const char* cgeGetVersion(); void cgePrintGLString(const char*, GLenum); -bool _cgeCheckGLError(const char* name, const char* file, int line); //请直接使用 cgeCheckGLError +bool _cgeCheckGLError(const char* name, const char* file, int line); // 请直接使用 cgeCheckGLError ////////////////////////////////////