]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/lib/libk/std_macros.cpp
update
[l4.git] / kernel / fiasco / src / lib / libk / std_macros.cpp
1 INTERFACE:
2
3 #if (__GNUC__>=3)
4 #  define BUILTIN_EXPECT(exp,c) __builtin_expect((exp),(c))
5 #  define EXPECT_TRUE(exp)      __builtin_expect((exp),true)
6 #  define EXPECT_FALSE(exp)     __builtin_expect((exp),false)
7 #else
8 #  define BUILTIN_EXPECT(exp,c) (exp)
9 #  define EXPECT_TRUE(exp)      (exp)
10 #  define EXPECT_FALSE(exp)     (exp)
11 #endif
12
13 // Use this for functions which do not examine any values except their
14 // arguments and have no effects except the return value. Note that a
15 // function that has pointer arguments and examines the data pointed to
16 // must _not_ be declared `const'.  Likewise, a function that calls a
17 // non-`const' function usually must not be `const'.  It does not make
18 // sense for a `const' function to return `void'.
19 #define FIASCO_CONST            __attribute__ ((__const__))
20
21 #ifdef __i386__
22 #define FIASCO_FASTCALL         __attribute__ ((__regparm__(3)))
23 #else
24 #define FIASCO_FASTCALL
25 #endif
26
27 #if (__GNUC__<3)
28 # define MARK_AS_DEPRECATED     /* empty */
29 # define ALWAYS_INLINE          /* empty */
30 # define FIASCO_NOINLINE
31 # define FIASCO_WARN_RESULT
32 #else
33 # define MARK_AS_DEPRECATED     __attribute__ ((__deprecated__))
34 # define ALWAYS_INLINE          __attribute__ ((__always_inline__))
35 # define FIASCO_NOINLINE        __attribute__ ((__noinline__))
36 # define FIASCO_WARN_RESULT     __attribute__ ((warn_unused_result))
37 #endif
38
39 #define FIASCO_NORETURN         __attribute__ ((__noreturn__))
40
41 IMPLEMENTATION:
42 //-