Statistics
| Branch: | Revision:

root / include / compiler.h @ abdb293f

History | View | Annotate | Download (736 Bytes)

1
#ifndef _BLKTAP_COMPILER_H
2
#define _BLKTAP_COMPILER_H
3

    
4
#ifdef __GNUC__
5
#define likely(_cond)           __builtin_expect(!!(_cond), 1)
6
#define unlikely(_cond)         __builtin_expect(!!(_cond), 0)
7
#endif
8

    
9
#ifndef likely
10
#define likely(_cond)           (_cond)
11
#endif
12

    
13
#ifndef unlikely
14
#define unlikely(_cond)         (_cond)
15
#endif
16

    
17
#ifdef __GNUC__
18
#define __printf(_f, _a)        __attribute__((format (printf, _f, _a)))
19
#define __scanf(_f, _a)         __attribute__((format (scanf, _f, _a)))
20
#define __noreturn              __attribute__((noreturn))
21
#endif
22

    
23
#ifndef __printf
24
#define __printf(_f, _a)
25
#endif
26

    
27
#ifndef __scanf
28
#define __scanf(_f, _a)
29
#endif
30

    
31
#ifndef __noreturn
32
#define __noreturn
33
#endif
34

    
35
#endif /* _BLKTAP_COMPILER_H */