[BACK]Return to compiler.h CVS log [TXT][DIR] Up to [Development] / linux-2.4-xfs / include / linux

File: [Development] / linux-2.4-xfs / include / linux / compiler.h (download)

Revision 1.4, Mon Nov 22 13:47:56 2004 UTC (12 years, 10 months ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -0 lines

Merge up to 2.4.28.
Merge of 2.4.x-xfs-melb:linux:20247a by kenmcd.

#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H

/* 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

#define likely(x)	__builtin_expect((x),1)
#define unlikely(x)	__builtin_expect((x),0)

#if __GNUC__ > 3
#define __attribute_used__	__attribute__((__used__))
#elif __GNUC__ == 3
#if  __GNUC_MINOR__ >= 3
# define __attribute_used__	__attribute__((__used__))
#else
# define __attribute_used__	__attribute__((__unused__))
#endif /* __GNUC_MINOR__ >= 3 */
#elif __GNUC__ == 2
#define __attribute_used__	__attribute__((__unused__))
#else
#define __attribute_used__	/* not implemented */
#endif /* __GNUC__ */

#if __GNUC__ == 3
#if __GNUC_MINOR__ >= 1
# define inline         __inline__ __attribute__((always_inline))
# define __inline__     __inline__ __attribute__((always_inline))
# define __inline       __inline__ __attribute__((always_inline))
#endif
#endif

/* no checker support, so we unconditionally define this as (null) */
#define __user
#define __iomem

#endif /* __LINUX_COMPILER_H */