1
0
Fork 0
forked from nuttx/nuttx-update

include/assert: fix nxstyle

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-03-20 14:54:47 +08:00 committed by Alan Carvalho de Assis
parent 216483f96b
commit 926bfe5818

View file

@ -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