1 /**************************************************************************
3 * Copyright 2007-2008 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
38 #if defined(_WIN32) && !defined(__WIN32__)
44 /* Avoid 'expression is always true' warning */
45 #pragma warning(disable: 4296)
52 typedef __int8
int8_t;
53 typedef unsigned __int8
uint8_t;
54 typedef __int16
int16_t;
55 typedef unsigned __int16
uint16_t;
56 #ifndef __eglplatform_h_
57 typedef __int32
int32_t;
59 typedef unsigned __int32
uint32_t;
60 typedef __int64
int64_t;
61 typedef unsigned __int64
uint64_t;
64 typedef __int64
intptr_t;
65 typedef unsigned __int64
uintptr_t;
67 typedef __int32
intptr_t;
68 typedef unsigned __int32
uintptr_t;
71 #define INT64_C(__val) __val##i64
72 #define UINT64_C(__val) __val##ui64
79 #define __bool_true_false_are_defined 1
80 #endif /* !__cplusplus */
83 #ifndef __STDC_LIMIT_MACROS
84 #define __STDC_LIMIT_MACROS 1
91 typedef unsigned int uint
;
92 typedef unsigned char ubyte
;
93 typedef unsigned short ushort
;
94 typedef uint64_t uint64
;
99 typedef unsigned char boolean
;
109 /* Function inlining */
111 # define INLINE inline
112 #elif defined(__GNUC__)
113 # define INLINE __inline__
114 #elif defined(_MSC_VER)
115 # define INLINE __inline
117 # define INLINE __inline
118 #elif defined(__INTEL_COMPILER)
119 # define INLINE inline
120 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
121 # define INLINE __inline
127 /* This should match linux gcc cdecl semantics everywhere, so that we
128 * just codegen one calling convention on all platforms.
131 #define PIPE_CDECL __cdecl
138 #if defined(__GNUC__)
139 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___aligned[SIZE] __attribute__(( aligned( 16 ) ))
140 #define ALIGN16_ASSIGN(NAME) NAME##___aligned
141 #define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) ))
143 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1]
144 #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
145 #define ALIGN16_ATTRIB
150 #endif /* P_COMPILER_H */