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__)
42 #if defined(_MSC_VER) && !defined(__MSC__)
49 /* Avoid 'expression is always true' warning */
50 #pragma warning(disable: 4296)
55 typedef unsigned int uint
;
56 typedef unsigned char ubyte
;
57 typedef unsigned char boolean
;
58 typedef unsigned short ushort
;
59 typedef unsigned long long uint64
;
65 typedef unsigned char uint8_t;
66 typedef short int16_t;
67 typedef unsigned short uint16_t;
69 typedef unsigned long uint32_t;
70 typedef long long int64_t;
71 typedef unsigned long long uint64_t;
74 typedef __int64
intptr_t;
75 typedef unsigned __int64
uintptr_t;
78 typedef unsigned int uintptr_t;
90 /* Function inlining */
92 # define INLINE __inline__
93 #elif defined(__MSC__)
94 # define INLINE __inline
96 # define INLINE __inline
97 #elif defined(__INTEL_COMPILER)
98 # define INLINE inline
99 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
100 # define INLINE __inline
106 /* This should match linux gcc cdecl semantics everywhere, so that we
107 * just codegen one calling convention on all platforms.
110 #define PIPE_CDECL __cdecl
118 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___aligned[SIZE] __attribute__(( aligned( 16 ) ))
119 #define ALIGN16_ASSIGN(NAME) NAME##___aligned
120 #define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) ))
122 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1]
123 #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
124 #define ALIGN16_ATTRIB
130 * For calling code-gen'd functions, phase out in favor of
131 * PIPE_CDECL, above, which really means cdecl on all platforms, not
134 #if !defined(XSTDCALL)
136 #define XSTDCALL __stdcall /* phase this out */
138 #define XSTDCALL /* XXX: NOTE! not STDCALL! */
143 #endif /* P_COMPILER_H */