Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4358 | Serge | 1 | /************************************************************************** |
2 | * |
||
3 | * Copyright 2009-2010 Chia-I Wu |
||
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" /* inline, __func__, etc. */ |
||
35 | |||
36 | |||
37 | /** |
||
38 | * Get standard integer types |
||
39 | */ |
||
40 | #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) |
||
41 | # include |
||
42 | #elif defined(_MSC_VER) |
||
43 | typedef __int8 int8_t; |
||
44 | typedef unsigned __int8 uint8_t; |
||
45 | typedef __int16 int16_t; |
||
46 | typedef unsigned __int16 uint16_t; |
||
47 | typedef __int32 int32_t; |
||
48 | typedef unsigned __int32 uint32_t; |
||
49 | typedef __int64 int64_t; |
||
50 | typedef unsigned __int64 uint64_t; |
||
51 | |||
52 | # if defined(_WIN64) |
||
53 | typedef __int64 intptr_t; |
||
54 | typedef unsigned __int64 uintptr_t; |
||
55 | # else |
||
56 | typedef __int32 intptr_t; |
||
57 | typedef unsigned __int32 uintptr_t; |
||
58 | # endif |
||
59 | |||
60 | # define INT64_C(__val) __val##i64 |
||
61 | # define UINT64_C(__val) __val##ui64 |
||
62 | #else |
||
63 | /* hope the best instead of adding a bunch of ifdef's */ |
||
64 | # include |
||
65 | #endif |
||
66 | |||
67 | |||
68 | /* XXX: Use standard `inline` keyword instead */ |
||
69 | #ifndef INLINE |
||
70 | # define INLINE inline |
||
71 | #endif |
||
72 | |||
73 | |||
74 | /** |
||
75 | * Function visibility |
||
76 | */ |
||
77 | #ifndef PUBLIC |
||
78 | # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) |
||
79 | # define PUBLIC __attribute__((visibility("default"))) |
||
80 | # elif defined(_MSC_VER) |
||
81 | # define PUBLIC __declspec(dllexport) |
||
82 | # else |
||
83 | # define PUBLIC |
||
84 | # endif |
||
85 | #endif |
||
86 | |||
87 | /* XXX: Use standard `__func__` instead */ |
||
88 | #ifndef __FUNCTION__ |
||
89 | # define __FUNCTION__ __func__ |
||
90 | #endif |
||
91 | |||
92 | #endif /* EGLCOMPILER_INCLUDED */ |