File: compiler.h

package info (click to toggle)
comedi 0.7.76%2B20080817cvs-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,660 kB
  • ctags: 14,259
  • sloc: ansic: 104,304; sh: 1,417; makefile: 625; perl: 457
file content (32 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * linux/compiler.h compatibility header
 */

#ifndef _COMPAT_COMPILER_H
#define _COMPAT_COMPILER_H

#include <linux/version.h>

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10)) \
	|| (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,4))

#include_next <linux/compiler.h>

#else

/* Somewhere in the middle of the GCC 2.96 development cycle, we implemented
   a mechanism by which the user can annotate likely branch directions and
   expect the blocks to be reordered appropriately.  Define __builtin_expect
   to nothing for earlier compilers.  */

#if __GNUC__ == 2 && __GNUC_MINOR__ < 96
#define __builtin_expect(x, expected_value) (x)
#endif
#endif

#ifndef likely
#define likely(x)	__builtin_expect(!!(x),1)
#define unlikely(x)	__builtin_expect(!!(x),0)
#endif

#endif /* _COMPAT_COMPILER_H */