Move likely/unlikely to compiler.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -121,12 +121,6 @@
|
||||
#define MSTR_(s) #s
|
||||
#define MSTR(s) MSTR_(s)
|
||||
|
||||
/// @brief Wrapper for gcc branch prediction builtin, for likely branch.
|
||||
#define likely(x) __builtin_expect(!!(x), 1)
|
||||
|
||||
/// @brief Wrapper for gcc branch prediction builtin, for unlikely branch.
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
// Use #s here to prevent macro expansion
|
||||
/// Macro used for shortening some debugging code.
|
||||
#define CASESTRRET(s) case s: return #s
|
||||
|
Reference in New Issue
Block a user