From fc80c70205727b8714e758399ae55e2dbd943d28 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 25 Oct 2023 11:32:19 +0800 Subject: [PATCH] assert: rename __ASSERT to __ASSERT__ to avoid conflict The definition of __ASSERT has special define in some OS and librarys, rename to __ASSERT__ to avoid conflict Signed-off-by: chao an --- include/assert.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/assert.h b/include/assert.h index 2c2f21cd5d..45d6e4d323 100644 --- a/include/assert.h +++ b/include/assert.h @@ -76,28 +76,28 @@ #define PANIC_WITH_REGS(msg, regs) _assert(__ASSERT_FILE__, \ __ASSERT_LINE__, msg, regs) -#define __ASSERT(f, file, line, _f) \ - do \ - { \ - if (predict_false(!(f))) \ - __assert(file, line, _f); \ - } \ +#define __ASSERT__(f, file, line, _f) \ + do \ + { \ + if (predict_false(!(f))) \ + __assert(file, line, _f); \ + } \ while (0) -#define __VERIFY(f, file, line, _f) \ - do \ - { \ - if (predict_false((f) < 0)) \ - __assert(file, line, _f); \ - } \ +#define __VERIFY__(f, file, line, _f) \ + do \ + { \ + if (predict_false((f) < 0)) \ + __assert(file, line, _f); \ + } \ while (0) #ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION -# define _ASSERT(f,file,line) __ASSERT(f, file, line, #f) -# define _VERIFY(f,file,line) __VERIFY(f, file, line, #f) +# define _ASSERT(f,file,line) __ASSERT__(f, file, line, #f) +# define _VERIFY(f,file,line) __VERIFY__(f, file, line, #f) #else -# define _ASSERT(f,file,line) __ASSERT(f, file, line, NULL) -# define _VERIFY(f,file,line) __VERIFY(f, file, line, NULL) +# define _ASSERT(f,file,line) __ASSERT__(f, file, line, NULL) +# define _VERIFY(f,file,line) __VERIFY__(f, file, line, NULL) #endif #ifdef CONFIG_DEBUG_ASSERTIONS