File: compiler_extensions.h

package info (click to toggle)
softgun 0.14-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,040 kB
  • ctags: 11,989
  • sloc: ansic: 70,651; makefile: 232
file content (23 lines) | stat: -rw-r--r-- 550 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
/*
 * ---------------------------------------------------
 * Use compiler builtins for better compilation
 * results. Taken from the linux kernel source
 * ---------------------------------------------------
 */
#ifndef COMPILER_EXTENSIONS_H
#define COMPILER_EXTENSIONS_H

#if __GNUC__ > 2
#define likely(x)       __builtin_expect(!!(x), 1)
#define unlikely(x)     __builtin_expect(!!(x), 0)
#else
#define likely(x)       x 
#define unlikely(x)     x 
#endif
#ifdef __GNUC__
#define UNUSED __attribute__((unused))
#else
#define UNUSED
#endif

#endif