gallium/draw: initial code to properly support llvm in the draw module
[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__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
68 || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
69 # define PUBLIC __attribute__((visibility("default")))
70 #else
71 # define PUBLIC
72 #endif
73
74 /**
75 * The __FUNCTION__ gcc variable is generally only used for debugging.
76 * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
77 * Don't define it if using a newer Windows compiler.
78 */
79 #ifndef __FUNCTION__
80 # if defined(__VMS)
81 # define __FUNCTION__ "VMS$NL:"
82 # elif ((!defined __GNUC__) || (__GNUC__ < 2)) && (!defined __xlC__) && \
83 (!defined(_MSC_VER) || _MSC_VER < 1300)
84 # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
85 (defined(__SUNPRO_C) && defined(__C99FEATURES__))
86 # define __FUNCTION__ __func__
87 # else
88 # define __FUNCTION__ "<unknown>"
89 # endif
90 # endif
91 #endif
92
93 #endif /* EGLCOMPILER_INCLUDED */