12345678910111213141516171819 |
- #ifndef CORE_CHECK_H
- #define CORE_CHECK_H
- #if defined(__GNUC__)
- #define check_format(format_index, arg_start_index) \
- __attribute__((format(printf, format_index, arg_start_index)))
- #else
- #error "please add a 'check_format' option"
- #endif
- #if defined(__GNUC__)
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else
- #define likely(x) x
- #define unlikely(x) x
- #endif
- #endif
|