forked from nuttx/nuttx-update
include/assert: fix nxstyle
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
parent
216483f96b
commit
926bfe5818
1 changed files with 33 additions and 7 deletions
|
@ -43,18 +43,44 @@
|
|||
#undef DEBUGVERIFY /* Like VERIFY, but only if CONFIG_DEBUG_ASSERTIONS is defined */
|
||||
|
||||
#ifndef CONFIG_HAVE_FILENAME
|
||||
# define __FILE__ NULL
|
||||
# define __LINE__ 0
|
||||
# define __FILE__ NULL
|
||||
# define __LINE__ 0
|
||||
#endif
|
||||
|
||||
#define PANIC() __assert(__FILE__, __LINE__, "panic")
|
||||
#define PANIC() __assert(__FILE__, __LINE__, "panic")
|
||||
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION
|
||||
#define ASSERT(f) do { if (predict_false(!(f))) __assert(__FILE__, __LINE__, #f); } while (0)
|
||||
#define VERIFY(f) do { if (predict_false((f) < 0)) __assert(__FILE__, __LINE__, #f); } while (0)
|
||||
# define ASSERT(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false(!(f))) \
|
||||
__assert(__FILE__, __LINE__, #f); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define VERIFY(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false((f) < 0)) \
|
||||
__assert(__FILE__, __LINE__, #f); \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define ASSERT(f) do { if (predict_false(!(f))) __assert(__FILE__, __LINE__, NULL); } while (0)
|
||||
#define VERIFY(f) do { if (predict_false((f) < 0)) __assert(__FILE__, __LINE__, NULL); } while (0)
|
||||
# define ASSERT(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false(!(f))) \
|
||||
__assert(__FILE__, __LINE__, NULL); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define VERIFY(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false((f) < 0)) \
|
||||
__assert(__FILE__, __LINE__, NULL); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
|
|
Loading…
Reference in a new issue