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