revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / mesa / src / egl / main / eglcompiler.h
blob0e13f441563e78d701c76cf73b437ef2809a684a
1 /**************************************************************************
3 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
4 * Copyright 2010 LunarG, Inc.
5 * All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sub license, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
15 * The above copyright notice and this permission notice (including the
16 * next paragraph) shall be included in all copies or substantial portions
17 * of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
27 **************************************************************************/
30 #ifndef EGLCOMPILER_INCLUDED
31 #define EGLCOMPILER_INCLUDED
34 /**
35 * Get standard integer types
37 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
38 # include <stdint.h>
39 # include <stddef.h>
40 #elif defined(_MSC_VER)
41 typedef __int8 int8_t;
42 typedef unsigned __int8 uint8_t;
43 typedef __int16 int16_t;
44 typedef unsigned __int16 uint16_t;
45 typedef __int32 int32_t;
46 typedef unsigned __int32 uint32_t;
47 typedef __int64 int64_t;
48 typedef unsigned __int64 uint64_t;
50 # if defined(_WIN64)
51 typedef __int64 intptr_t;
52 typedef unsigned __int64 uintptr_t;
53 # else
54 typedef __int32 intptr_t;
55 typedef unsigned __int32 uintptr_t;
56 # endif
58 # define INT64_C(__val) __val##i64
59 # define UINT64_C(__val) __val##ui64
60 #else
61 /* hope the best instead of adding a bunch of ifdef's */
62 # include <stdint.h>
63 #endif
66 /**
67 * Function inlining
69 #if defined(__GNUC__)
70 # define INLINE __inline__
71 #elif defined(__MSC__)
72 # define INLINE __inline
73 #elif defined(_MSC_VER)
74 # define INLINE __inline
75 #elif defined(__ICL)
76 # define INLINE __inline
77 #elif defined(__INTEL_COMPILER)
78 # define INLINE inline
79 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
80 # define INLINE __inline
81 #elif defined(__SUNPRO_C) && defined(__C99FEATURES__)
82 # define INLINE inline
83 # define __inline inline
84 # define __inline__ inline
85 #elif (__STDC_VERSION__ >= 199901L) /* C99 */
86 # define INLINE inline
87 #else
88 # define INLINE
89 #endif
92 /**
93 * Function visibility
95 #ifndef PUBLIC
96 # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
97 # define PUBLIC __attribute__((visibility("default")))
98 # elif defined(_MSC_VER)
99 # define PUBLIC __declspec(dllexport)
100 # else
101 # define PUBLIC
102 # endif
103 #endif
106 * The __FUNCTION__ gcc variable is generally only used for debugging.
107 * If we're not using gcc, define __FUNCTION__ as a cpp symbol here.
108 * Don't define it if using a newer Windows compiler.
110 #ifndef __FUNCTION__
111 # if defined(__VMS)
112 # define __FUNCTION__ "VMS$NL:"
113 # elif (!defined __GNUC__) && (!defined __xlC__) && \
114 (!defined(_MSC_VER) || _MSC_VER < 1300)
115 # if (__STDC_VERSION__ >= 199901L) /* C99 */ || \
116 (defined(__SUNPRO_C) && defined(__C99FEATURES__))
117 # define __FUNCTION__ __func__
118 # else
119 # define __FUNCTION__ "<unknown>"
120 # endif
121 # endif
122 #endif
124 #endif /* EGLCOMPILER_INCLUDED */