input: retry if O_NOATIME fails
[mmq.git] / compat / cc.h
blob52e54694205bad40a88412bf89cc1d8e952331c3
1 #ifndef COMPAT__CC_H
2 #define COMPAT__CC_H
4 /*
5 * this allows us to take advantage of special gcc features while still
6 * allowing other compilers to compile:
8 * example taken from: http://rlove.org/log/2005102601
9 */
11 #if defined(__GNUC__) && (__GNUC__ >= 3)
12 # define CONST __attribute__ ((const))
13 # define DEPRECATED __attribute__ ((deprecated))
14 # define MUST_CHECK __attribute__ ((warn_unused_result))
15 # define NORETURN __attribute__ ((noreturn))
16 # define PACKED __attribute__ ((packed))
17 /* these are very useful for type checking */
18 # define PRINTF __attribute__ ((format(printf,1,2)))
19 # define DPRINTF __attribute__ ((format(printf,2,3)))
20 # define PURE __attribute__ ((pure))
21 # define UNUSED __attribute__ ((unused))
22 # define USED __attribute__ ((used))
23 /* # define inline inline __attribute__ ((always_inline)) */
24 # define NOINLINE __attribute__ ((noinline))
25 # define likely(x) __builtin_expect (!!(x), 1)
26 # define unlikely(x) __builtin_expect (!!(x), 0)
27 #else /* __GNUC__ || __GNUC__ < 3 */
28 # define CONST
29 # define DEPRECATED
30 # define MALLOC
31 # define MUST_CHECK
32 # define NORETURN
33 # define PACKED
34 # define PRINTF
35 # define DPRINTF
36 # define PURE
37 # define UNUSED
38 # define USED
39 # define NOINLINE
40 # define likely(x) (x)
41 # define unlikely(x) (x)
42 #endif /* __GNUC__ && __GNUC__ >= 3 */
44 #endif /* COMPAT__CC_H */