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 #include "xf86_ansic.h"
39 #include "xf86_libc.h"
43 #if defined(_WIN32) && !defined(__WIN32__)
49 /* Avoid 'expression is always true' warning */
50 #pragma warning(disable: 4296)
57 typedef __int8
int8_t;
58 typedef unsigned __int8
uint8_t;
59 typedef __int16
int16_t;
60 typedef unsigned __int16
uint16_t;
61 #ifndef __eglplatform_h_
62 typedef __int32
int32_t;
64 typedef unsigned __int32
uint32_t;
65 typedef __int64
int64_t;
66 typedef unsigned __int64
uint64_t;
69 typedef __int64
intptr_t;
70 typedef unsigned __int64
uintptr_t;
72 typedef __int32
intptr_t;
73 typedef unsigned __int32
uintptr_t;
76 #define INT64_C(__val) __val##i64
77 #define UINT64_C(__val) __val##ui64
84 #define __bool_true_false_are_defined 1
85 #endif /* !__cplusplus */
88 #ifndef __STDC_LIMIT_MACROS
89 #define __STDC_LIMIT_MACROS 1
96 typedef unsigned int uint
;
97 typedef unsigned char ubyte
;
98 typedef unsigned short ushort
;
99 typedef uint64_t uint64
;
104 typedef unsigned char boolean
;
114 /* Function inlining */
116 # define INLINE inline
117 #elif defined(__GNUC__)
118 # define INLINE __inline__
119 #elif defined(_MSC_VER)
120 # define INLINE __inline
122 # define INLINE __inline
123 #elif defined(__INTEL_COMPILER)
124 # define INLINE inline
125 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
126 # define INLINE __inline
132 /* This should match linux gcc cdecl semantics everywhere, so that we
133 * just codegen one calling convention on all platforms.
136 #define PIPE_CDECL __cdecl
143 #if defined(__GNUC__)
144 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___aligned[SIZE] __attribute__(( aligned( 16 ) ))
145 #define ALIGN16_ASSIGN(NAME) NAME##___aligned
146 #define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) ))
147 #define ALIGN32_ATTRIB __attribute__(( aligned( 32 ) ))
149 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1]
150 #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
151 #define ALIGN16_ATTRIB
152 #define ALIGN32_ATTRIB
157 #endif /* P_COMPILER_H */