![]() |
RTXI 1.3
|
00001 /* 00002 * linux/compiler.h compatibility header 00003 */ 00004 00005 #ifndef _COMPAT_COMPILER_H 00006 #define _COMPAT_COMPILER_H 00007 00008 #include <linux/version.h> 00009 00010 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10)) \ 00011 || (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,4)) 00012 00013 #include_next <linux/compiler.h> 00014 00015 #else 00016 00017 /* Somewhere in the middle of the GCC 2.96 development cycle, we implemented 00018 a mechanism by which the user can annotate likely branch directions and 00019 expect the blocks to be reordered appropriately. Define __builtin_expect 00020 to nothing for earlier compilers. */ 00021 00022 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 00023 #define __builtin_expect(x, expected_value) (x) 00024 #endif 00025 #endif 00026 00027 #ifndef likely 00028 #define likely(x) __builtin_expect(!!(x),1) 00029 #define unlikely(x) __builtin_expect(!!(x),0) 00030 #endif 00031 00032 #endif /* _COMPAT_COMPILER_H */