Merge branch '7.8'
[mesa.git] / src / egl / main / eglcompiler.h
1 #ifndef EGLCOMPILER_INCLUDED
2 #define EGLCOMPILER_INCLUDED
3
4
5 /**
6 * Get standard integer types
7 */
8 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
9 # include <stdint.h>
10 #elif defined(_MSC_VER)
11 typedef __int8 int8_t;
12 typedef unsigned __int8 uint8_t;
13 typedef __int16 int16_t;
14 typedef unsigned __int16 uint16_t;
15 # ifndef __eglplatform_h_
16 typedef __int32 int32_t;
17 # endif
18 typedef unsigned __int32 uint32_t;
19 typedef __int64 int64_t;
20 typedef unsigned __int64 uint64_t;
21
22 # if defined(_WIN64)
23 typedef __int64 intptr_t;
24 typedef unsigned __int64 uintptr_t;
25 # else
26 typedef __int32 intptr_t;
27 typedef unsigned __int32 uintptr_t;
28 # endif
29
30 # define INT64_C(__val) __val##i64
31 # define UINT64_C(__val) __val##ui64
32 #else
33 /* hope the best instead of adding a bunch of ifdef's */
34 # include <stdint.h>
35 #endif
36
37
38 /**
39 * Function inlining
40 */
41 #if defined(__GNUC__)
42 # define INLINE __inline__
43 #elif defined(__MSC__)
44 # define INLINE __inline
45 #elif defined(_MSC_VER)
46 # define INLINE __inline
47 #elif defined(__ICL)
48 # define INLINE __inline
49 #elif defined(__INTEL_COMPILER)
50 # define INLINE inline
51 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
52 # define INLINE __inline
53 #elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
54 # define INLINE inline
55 # define __inline inline
56 # define __inline__ inline
57 #elif (__STDC_VERSION__ >= 199901L) /* C99 */
58 # define INLINE inline
59 #else
60 # define INLINE
61 #endif
62
63
64 /**
65 * Function visibility
66 */
67 #if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
68 # define PUBLIC __attribute__((visibility("default")))
69 #else
70 # define PUBLIC
71 #endif
72
73 /**
74 * The __FUNCTION__ gcc variable is generally only used for debugging.
75 * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
76 * Don't define it if using a newer Windows compiler.
77 */
78 #ifndef __FUNCTION__
79 # if defined(__VMS)
80 # define __FUNCTION__ "VMS$NL:"
81 # elif (!defined __GNUC__) && (!defined __xlC__) && \
82 (!defined(_MSC_VER) || _MSC_VER < 1300)
83 # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
84 (defined(__SUNPRO_C) && defined(__C99FEATURES__))
85 # define __FUNCTION__ __func__
86 # else
87 # define __FUNCTION__ "<unknown>"
88 # endif
89 # endif
90 #endif
91
92 #endif /* EGLCOMPILER_INCLUDED */