00001
00007
00008 #ifndef __L4_COMPILER_H__
00009 #define __L4_COMPILER_H__
00010
00011 #if !defined(__ASSEMBLY__) && !defined(__ASSEMBLER__)
00012
00013
00014
00015
00016
00022 #ifndef L4_INLINE
00023 #ifndef __cplusplus
00024 # ifdef __OPTIMIZE__
00025 # ifdef STATIC_L4_INLINE
00026 # define L4_INLINE static __inline__
00027 # else
00028 # define L4_INLINE extern __inline__
00029 # endif
00030 # else
00031 # define L4_INLINE static
00032 # endif
00033 #else
00034 # define L4_INLINE inline
00035 #endif
00036 #endif
00037
00053 #ifndef __cplusplus
00054 # define EXTERN_C_BEGIN
00055 # define EXTERN_C_END
00056 # define EXTERN_C
00057 #else
00058 # define EXTERN_C_BEGIN extern "C" {
00059 # define EXTERN_C_END }
00060 # define EXTERN_C extern "C"
00061 #endif
00062
00068 #define L4_NORETURN __attribute__((noreturn))
00069
00075 #define L4_NOINSTRUMENT __attribute__((no_instrument_function))
00076
00077 #endif
00078
00079 #include <l4/sys/linkage.h>
00080
00081 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
00082 #define __builtin_expect(x, expected_value) (x)
00083 #endif
00084
00085 #define EXPECT_TRUE(x) __builtin_expect((x),1)
00086 #define EXPECT_FALSE(x) __builtin_expect((x),0)
00087
00088 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ >= 4
00089
00090
00091 #define L4_STICKY(x) __attribute__((used)) x
00092
00093
00094 #define L4_DEPRECATED __attribute__((deprecated))
00095 #else
00096
00097
00098 #define L4_STICKY(x) __attribute__((unused)) x
00099 #define L4_DEPRECATED
00100 #endif
00101
00102 #define L4_stringify_helper(x) #x
00103 #define L4_stringify(x) L4_stringify_helper(x)
00104
00105 #endif