egl/main: replace __FUNCTION__ with __func__
[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 /**
35 * Get standard integer types
36 */
37 #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
38 (defined(_MSC_VER) && _MSC_VER >= 1600)
39 # include <stdint.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;
49
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
57
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
64
65
66 /**
67 * Function visibility
68 */
69 #ifndef PUBLIC
70 # if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
71 # define PUBLIC __attribute__((visibility("default")))
72 # elif defined(_MSC_VER)
73 # define PUBLIC __declspec(dllexport)
74 # else
75 # define PUBLIC
76 # endif
77 #endif
78
79 #define STATIC_ASSERT(COND) \
80 do { \
81 (void) sizeof(char [1 - 2*!(COND)]); \
82 } while (0)
83
84 #endif /* EGLCOMPILER_INCLUDED */