mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 06:39:01 +08:00
assert.h: Replace NULL with 0 to avoid including stddef.h
Fix error: 'NULL' undeclared if user include assert.h only Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
+13
-13
@@ -43,7 +43,7 @@
|
||||
#undef DEBUGVERIFY /* Like VERIFY, but only if CONFIG_DEBUG_ASSERTIONS is defined */
|
||||
|
||||
#ifndef CONFIG_HAVE_FILENAME
|
||||
# define __FILE__ NULL
|
||||
# define __FILE__ 0
|
||||
# define __LINE__ 0
|
||||
#endif
|
||||
|
||||
@@ -66,20 +66,20 @@
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
# define ASSERT(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false(!(f))) \
|
||||
__assert(__FILE__, __LINE__, NULL); \
|
||||
} \
|
||||
# define ASSERT(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false(!(f))) \
|
||||
__assert(__FILE__, __LINE__, 0); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
# define VERIFY(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false((f) < 0)) \
|
||||
__assert(__FILE__, __LINE__, NULL); \
|
||||
} \
|
||||
# define VERIFY(f) \
|
||||
do \
|
||||
{ \
|
||||
if (predict_false((f) < 0)) \
|
||||
__assert(__FILE__, __LINE__, 0); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user