Tizen 2.0 Release
[profile/ivi/osmesa.git] / src / mapi / mapi / u_compiler.h
1 #ifndef _U_COMPILER_H_
2 #define _U_COMPILER_H_
3
4 /* Function inlining */
5 #ifndef INLINE
6 #  ifdef __cplusplus
7 #    define INLINE inline
8 #  elif defined(__GNUC__)
9 #    define INLINE __inline__
10 #  elif defined(_MSC_VER)
11 #    define INLINE __inline
12 #  elif defined(__ICL)
13 #    define INLINE __inline
14 #  elif defined(__INTEL_COMPILER)
15 #    define INLINE inline
16 #  elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
17 #    define INLINE __inline
18 #  elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
19 #    define INLINE inline
20 #  elif (__STDC_VERSION__ >= 199901L) /* C99 */
21 #    define INLINE inline
22 #  else
23 #    define INLINE
24 #  endif
25 #endif
26
27 /* Function visibility */
28 #ifndef PUBLIC
29 #  if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
30 #    define PUBLIC __attribute__((visibility("default")))
31 #  elif defined(_MSC_VER)
32 #    define PUBLIC __declspec(dllexport)
33 #  else
34 #    define PUBLIC
35 #  endif
36 #endif
37
38 #ifndef likely
39 #  if defined(__GNUC__)
40 #    define likely(x)   __builtin_expect(!!(x), 1)
41 #    define unlikely(x) __builtin_expect(!!(x), 0)
42 #  else
43 #    define likely(x)   (x)
44 #    define unlikely(x) (x)
45 #  endif
46 #endif
47
48 #endif /* _U_COMPILER_H_ */