Loading...
Searching...
No Matches
Go to the documentation of this file.
22#if defined(__GNUC__) || defined(__clang__)
23#define likely(x) __builtin_expect(!!(x),1)
24#define unlikely(x) __builtin_expect(!!(x), 0)
25#elif defined(_MSC_VER)
26#define likely(x) ((x) ? (1) : (__assume(0), 0))
27#define unlikely(x) ((x) ? (__assume(0), 1) : 0)
30#define unlikely(x) (x)
89#define fallthrough do {} while (0)
114#define __must_check __attribute__((warn_unused_result))
144#define __printf(fmt_idx, arg_idx) __attribute__((__format__(__printf__, fmt_idx, arg_idx)))
154#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
174#ifndef OPTIMIZER_HIDE_VAR
176#define OPTIMIZER_HIDE_VAR(var) \
177 __asm__ ("" : "=r" (var) : "0" (var))
200#ifndef __BUILD_BUG_ON_ZERO_MSG
216#define __BUILD_BUG_ON_ZERO_MSG(e, msg, ...) \
217 ((int)(0 * sizeof(struct {_Static_assert(!(e), msg);})))
222#define __is_array(a) (!__same_type((a), &(a)[0]))
225#ifndef __must_be_array
226#define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
230#ifndef __is_constexpr
231#define __is_constexpr(x) \
232 (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))