Move likely/unlikely to compiler.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-15 19:11:46 +00:00
parent b73dce1d6d
commit 68873efaa2
3 changed files with 7 additions and 8 deletions

View File

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