fixed conformance problems in min/max and histogram result packing
[mesa.git] / src / mesa / main / glheader.h
1 /* $Id: glheader.h,v 1.15 2000/09/26 20:53:53 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.5
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 #ifndef GLHEADER_H
29 #define GLHEADER_H
30
31
32 /*
33 * This is the top-most include file of the Mesa sources.
34 * It includes gl.h and all system headers which are needed.
35 * Other Mesa source files should _not_ directly include any system
36 * headers. This allows Mesa to be integrated into XFree86 and
37 * allows system-dependent hacks/work-arounds to be collected in one place.
38 *
39 * If you touch this file, everything gets recompiled!
40 *
41 * This file should be included before any other header in the .c files.
42 */
43
44
45 #ifdef XFree86LOADER
46 #include "xf86_ansic.h"
47 #else
48 #include <assert.h>
49 #include <ctype.h>
50 /* If we can use Compaq's Fast Math Library on Alpha */
51 #if defined(__alpha__) && defined(CCPML)
52 #include <cpml.h>
53 #else
54 #include <math.h>
55 #endif
56 #include <limits.h>
57 #include <stdlib.h>
58 #include <stdio.h>
59 #include <string.h>
60 #if defined(__linux__) && defined(__i386__)
61 #include <fpu_control.h>
62 #endif
63 #endif
64 #include <float.h>
65
66
67 #ifdef HAVE_CONFIG_H
68 #include "conf.h"
69 #endif
70
71
72
73
74 /*
75 * Put compiler/OS/assembly pragmas and macros here to avoid
76 * cluttering other source files.
77 */
78
79
80
81 /*
82 * XXX move as many of these pragma's and MS Windows-isms into
83 * the new src/glheader.h file.
84 */
85
86 #if defined(_WIN32) && !defined(__WIN32__)
87 # define __WIN32__
88 #endif
89
90 #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
91 # pragma warning( disable : 4068 ) /* unknown pragma */
92 # pragma warning( disable : 4710 ) /* function 'foo' not inlined */
93 # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
94 # pragma warning( disable : 4127 ) /* conditional expression is constant */
95 # if defined(MESA_MINWARN)
96 # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
97 # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
98 # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
99 # pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
100 # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
101 # endif
102 # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
103 # define GLAPI __declspec(dllexport)
104 # define WGLAPI __declspec(dllexport)
105 # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
106 # define GLAPI __declspec(dllimport)
107 # define WGLAPI __declspec(dllimport)
108 # else /* for use with static link lib build of Win32 edition only */
109 # define GLAPI extern
110 # define WGLAPI __declspec(dllimport)
111 # endif /* _STATIC_MESA support */
112 # define GLAPIENTRY __stdcall
113 # define GLAPIENTRYP __stdcall *
114 # define GLCALLBACK __stdcall
115 # define GLCALLBACKP __stdcall *
116 # if defined(__CYGWIN__)
117 # define GLCALLBACKPCAST *
118 # else
119 # define GLCALLBACKPCAST __stdcall *
120 # endif
121 # define GLWINAPI __stdcall
122 # define GLWINAPIV __cdecl
123 #else
124 /* non-Windows compilation */
125 # define GLAPI extern
126 # define GLAPIENTRY
127 # define GLAPIENTRYP *
128 # define GLCALLBACK
129 # define GLCALLBACKP *
130 # define GLCALLBACKPCAST *
131 # define GLWINAPI
132 # define GLWINAPIV
133 #endif /* WIN32 / CYGWIN bracket */
134
135 /* compatability guard so we don't need to change client code */
136
137 #if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
138 #if 0
139 # define CALLBACK GLCALLBACK
140 typedef void *HGLRC;
141 typedef void *HDC;
142 #endif
143 typedef int (GLAPIENTRY *PROC)();
144 typedef unsigned long COLORREF;
145 #endif
146
147
148 /* Make sure we include glext.h from gl.h */
149 #define GL_GLEXT_PROTOTYPES
150
151
152 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
153 # define WGL_FONT_LINES 0
154 # define WGL_FONT_POLYGONS 1
155 #ifndef _GNU_H_WINDOWS32_FUNCTIONS
156 # ifdef UNICODE
157 # define wglUseFontBitmaps wglUseFontBitmapsW
158 # define wglUseFontOutlines wglUseFontOutlinesW
159 # else
160 # define wglUseFontBitmaps wglUseFontBitmapsA
161 # define wglUseFontOutlines wglUseFontOutlinesA
162 # endif /* !UNICODE */
163 #endif /* _GNU_H_WINDOWS32_FUNCTIONS */
164 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
165 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
166 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
167 #include <gl/mesa_wgl.h>
168 #endif
169
170
171
172
173 #include "GL/gl.h"
174 #include "GL/glext.h"
175
176
177 #ifndef CAPI
178 #define CAPI
179 #endif
180 #include "glcore.h"
181
182
183
184 /* Disable unreachable code warnings for Watcom C++ */
185 #ifdef __WATCOMC__
186 #pragma disable_message(201)
187 #endif
188
189
190 /* Turn off macro checking systems used by other libraries */
191 #ifdef CHECK
192 #undef CHECK
193 #endif
194
195
196 /* Create a macro so that asm functions can be linked into compilers other
197 * than GNU C
198 */
199 #ifndef _ASMAPI
200 #if !defined( __GNUC__ ) && !defined( VMS )
201 #define _ASMAPI __cdecl
202 #else
203 #define _ASMAPI
204 #endif
205 #ifdef PTR_DECL_IN_FRONT
206 #define _ASMAPIP * _ASMAPI
207 #else
208 #define _ASMAPIP _ASMAPI *
209 #endif
210 #endif
211
212 #ifdef USE_X86_ASM
213 #define _NORMAPI _ASMAPI
214 #define _NORMAPIP _ASMAPIP
215 #else
216 #define _NORMAPI
217 #define _NORMAPIP *
218 #endif
219
220
221
222 #endif /* GLHEADER_H */