mirror of
https://github.com/apache/nuttx.git
synced 2026-09-26 18:16:27 +08:00
include/compiler: replace likely to predict_true
likely is defined repeatedly in an external library Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
b91042e5a0
commit
216483f96b
+4
-4
@@ -50,11 +50,11 @@
|
||||
#define PANIC() __assert(__FILE__, __LINE__, "panic")
|
||||
|
||||
#ifdef CONFIG_DEBUG_ASSERTIONS_EXPRESSION
|
||||
#define ASSERT(f) do { if (unlikely(!(f))) __assert(__FILE__, __LINE__, #f); } while (0)
|
||||
#define VERIFY(f) do { if (unlikely((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 (unlikely(!(f))) __assert(__FILE__, __LINE__, NULL); } while (0)
|
||||
#define VERIFY(f) do { if (unlikely((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
|
||||
|
||||
Reference in New Issue
Block a user