build: Move src/mapi/mapi/* to src/mapi/
[mesa.git] / src / mapi / u_compiler.h
1 #ifndef _U_COMPILER_H_
2 #define _U_COMPILER_H_
3
4 #include "c99_compat.h" /* inline, __func__, etc. */
5
6
7 /* XXX: Use standard `inline` keyword instead */
8 #ifndef INLINE
9 # define INLINE inline
10 #endif
11
12 /* Function visibility */
13 #ifndef PUBLIC
14 # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
15 # define PUBLIC __attribute__((visibility("default")))
16 # elif defined(_MSC_VER)
17 # define PUBLIC __declspec(dllexport)
18 # else
19 # define PUBLIC
20 # endif
21 #endif
22
23 #ifndef likely
24 # if defined(__GNUC__)
25 # define likely(x) __builtin_expect(!!(x), 1)
26 # define unlikely(x) __builtin_expect(!!(x), 0)
27 # else
28 # define likely(x) (x)
29 # define unlikely(x) (x)
30 # endif
31 #endif
32
33 #endif /* _U_COMPILER_H_ */