Find file
8d6b76d May 23, 2015
@tj @rindeal
18 lines (13 sloc) 309 Bytes
//
// unlikely.h
//
#ifndef UNLIKELY_H
#define UNLIKELY_H
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define likely(expr) __builtin_expect(!!(expr), 1)
#define unlikely(expr) __builtin_expect(!!(expr), 0)
#else
#define likely(expr) (expr)
#define unlikely(expr) (expr)
#endif
#endif