3 # define likely(x) __builtin_expect((x),1)
4 # define unlikely(x) __builtin_expect((x),0)
6 # define noinline __attribute__((noinline))
8 # define noinline __attribute__((noinline,noclone))
10 # define unused __attribute__((unused))
12 # define likely(x) (x)
13 # define unlikely(x) (x)
19 #define __has_builtin(x) 0
22 #if __has_builtin(__builtin_add_overflow) || (defined(__GNUC__) && __GNUC__ >= 5)
23 #define add_overflow(a, b, r) __builtin_add_overflow(a, b, &(r))
24 #define sub_overflow(a, b, r) __builtin_sub_overflow(a, b, &(r))
26 #define add_overflow(a, b, r) ({r = (u32)a + (u32)b; (a ^ ~b) & (a ^ r) & (1u<<31);})
27 #define sub_overflow(a, b, r) ({r = (u32)a - (u32)b; (a ^ b) & (a ^ r) & (1u<<31);})