Remove (un)likely from the kernel interface (XCC)
[akaros.git] / kern / include / compiler.h
1 #ifndef ROS_KERN_COMPILER_H
2 #define ROS_KERN_COMPILER_H
3
4 #ifdef __GNUC__
5
6 #define likely(x) __builtin_expect(!!(x), 1)
7 #define unlikely(x) __builtin_expect(!!(x), 0)
8
9 #else /* #ifdef __GNUC__ */
10
11 #define likely(x) (x)
12 #define unlikely(x) (x)
13
14 #endif /* #ifdef __GNUC__ */
15
16 #endif /* ROS_KERN_COMPILER_H */