added PSIZE
[mesa.git] / src / mesa / pipe / p_compiler.h
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
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:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
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.
25 *
26 **************************************************************************/
27
28 #ifndef P_COMPILER_H
29 #define P_COMPILER_H
30
31 #include <assert.h>
32 #include <stdlib.h>
33 #include <string.h>
34 #include <stdio.h>
35
36
37 #if defined(_WIN32) && !defined(__WIN32__)
38 #define __WIN32__
39 #endif
40
41 #if defined(_MSC_VER) && !defined(__MSC__)
42 #define __MSC__
43 #endif
44
45
46 typedef unsigned int uint;
47 typedef unsigned char ubyte;
48 typedef unsigned char boolean;
49 typedef unsigned short ushort;
50 typedef unsigned long long uint64;
51
52
53 #define TRUE 1
54 #define FALSE 0
55
56
57 /* Function inlining */
58 #if defined(__GNUC__)
59 # define INLINE __inline__
60 #elif defined(__MSC__)
61 # define INLINE __inline
62 #elif defined(__ICL)
63 # define INLINE __inline
64 #elif defined(__INTEL_COMPILER)
65 # define INLINE inline
66 #elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100)
67 # define INLINE __inline
68 #else
69 # define INLINE
70 #endif
71
72
73 #if defined __GNUC__
74 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___aligned[SIZE] __attribute__(( aligned( 16 ) ))
75 #define ALIGN16_ASSIGN(NAME) NAME##___aligned
76 #else
77 #define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1]
78 #define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
79 #endif
80
81
82
83 #endif /* P_COMPILER_H */