From 4399f15874b03e0f86eb949de4a4ebf0430c0039 Mon Sep 17 00:00:00 2001 From: Nanako <469449812@qq.com> Date: Tue, 30 Jul 2024 20:53:03 +0800 Subject: [PATCH] =?UTF-8?q?Develop:=20=E4=BF=AE=E6=94=B9check=E5=9C=A8?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E6=97=B6=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/misc/core_assert.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/misc/core_assert.h b/core/misc/core_assert.h index 51966f8..c177ebc 100644 --- a/core/misc/core_assert.h +++ b/core/misc/core_assert.h @@ -3,6 +3,7 @@ #include // 定义 check 宏 +#if BUILD_DEBUG #define check(expr) \ do { \ if (!(expr)) { \ @@ -19,6 +20,10 @@ do { \ assert(expr); \ } \ } while (0) +#else +#define check(expr) +#define checkf(expr, msg, ...) +#endif // 定义 ensure 宏 #if BUILD_DEBUG