egl/main: replace INLINE with inline
[mesa.git] / src / egl / main / eglcompiler.h
1 /**************************************************************************
2 *
3 * Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
4 * Copyright 2010 LunarG, Inc.
5 * All Rights Reserved.
6 *
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:
14 *
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.
18 *
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.
26 *
27 **************************************************************************/
28
29
30 #ifndef EGLCOMPILER_INCLUDED
31 #define EGLCOMPILER_INCLUDED
32
33
34 #include "c99_compat.h" /* __func__, etc. */
35
36
37 /**
38 * Get standard integer types
39 */
40 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
41 (defined(_MSC_VER) && _MSC_VER >= 1600)
42 # include <stdint.h>
43 #elif defined(_MSC_VER)
44 typedef __int8 int8_t;
45 typedef unsigned __int8 uint8_t;
46 typedef __int16 int16_t;
47 typedef unsigned __int16 uint16_t;
48 typedef __int32 int32_t;
49 typedef unsigned __int32 uint32_t;
50 typedef __int64 int64_t;
51 typedef unsigned __int64 uint64_t;
52
53 # if defined(_WIN64)
54 typedef __int64 intptr_t;
55 typedef unsigned __int64 uintptr_t;
56 # else
57 typedef __int32 intptr_t;
58 typedef unsigned __int32 uintptr_t;
59 # endif
60
61 # define INT64_C(__val) __val##i64
62 # define UINT64_C(__val) __val##ui64
63 #else
64 /* hope the best instead of adding a bunch of ifdef's */
65 # include <stdint.h>
66 #endif
67
68
69 /**
70 * Function visibility
71 */
72 #ifndef PUBLIC
73 # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
74 # define PUBLIC __attribute__((visibility("default")))
75 # elif defined(_MSC_VER)
76 # define PUBLIC __declspec(dllexport)
77 # else
78 # define PUBLIC
79 # endif
80 #endif
81
82 /* XXX: Use standard `__func__` instead */
83 #ifndef __FUNCTION__
84 # define __FUNCTION__ __func__
85 #endif
86
87 #define STATIC_ASSERT(COND) \
88 do { \
89 (void) sizeof(char [1 - 2*!(COND)]); \
90 } while (0)
91
92 #endif /* EGLCOMPILER_INCLUDED */