aboutsummaryrefslogtreecommitdiffstats
path: root/compiler.h
blob: 63181db9af68cd0a139c3e887337e4eae32248d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef LIBUCD_COMPILER_H
#define LIBUCD_COMPILER_H

#if defined(__GNUC__)

#define ALIGNED(x) __attribute__((aligned(x)))
#define noreturn void __attribute__((noreturn))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)

#else

#define ALIGNED(x)
#define noreturn void
#define likely(x) (!!(x))
#define unlikely(x) (!!(x))

#endif

#endif /* LIBUCD_COMPILER_H */