1 /* $Id: glheader.h,v 1.11 2000/06/12 15:40:47 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
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:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
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.
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.
39 * If you touch this file, everything gets recompiled!
41 * This file should be included before any other header in the .c files.
46 #include "xf86_ansic.h"
55 #if defined(__linux__) && defined(__i386__)
56 #include <fpu_control.h>
70 * Put compiler/OS/assembly pragmas and macros here to avoid
71 * cluttering other source files.
77 * XXX move as many of these pragma's and MS Windows-isms into
78 * the new src/glheader.h file.
81 #if defined(_WIN32) && !defined(__WIN32__)
85 #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
86 # pragma warning( disable : 4068 ) /* unknown pragma */
87 # pragma warning( disable : 4710 ) /* function 'foo' not inlined */
88 # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
89 # pragma warning( disable : 4127 ) /* conditional expression is constant */
90 # if defined(MESA_MINWARN)
91 # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
92 # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
93 # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
94 # pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
95 # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
97 # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
98 # define GLAPI __declspec(dllexport)
99 # define WGLAPI __declspec(dllexport)
100 # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
101 # define GLAPI __declspec(dllimport)
102 # define WGLAPI __declspec(dllimport)
103 # else /* for use with static link lib build of Win32 edition only */
104 # define GLAPI extern
105 # define WGLAPI __declspec(dllimport)
106 # endif /* _STATIC_MESA support */
107 # define GLAPIENTRY __stdcall
108 # define GLAPIENTRYP __stdcall *
109 # define GLCALLBACK __stdcall
110 # define GLCALLBACKP __stdcall *
111 # if defined(__CYGWIN__)
112 # define GLCALLBACKPCAST *
114 # define GLCALLBACKPCAST __stdcall *
116 # define GLWINAPI __stdcall
117 # define GLWINAPIV __cdecl
119 /* non-Windows compilation */
120 # define GLAPI extern
122 # define GLAPIENTRYP *
124 # define GLCALLBACKP *
125 # define GLCALLBACKPCAST *
128 #endif /* WIN32 / CYGWIN bracket */
130 /* compatability guard so we don't need to change client code */
132 #if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
134 # define CALLBACK GLCALLBACK
136 typedef int (GLAPIENTRY
*PROC
)();
139 typedef unsigned long COLORREF
;
142 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
143 # define WGL_FONT_LINES 0
144 # define WGL_FONT_POLYGONS 1
145 #ifndef _GNU_H_WINDOWS32_FUNCTIONS
147 # define wglUseFontBitmaps wglUseFontBitmapsW
148 # define wglUseFontOutlines wglUseFontOutlinesW
150 # define wglUseFontBitmaps wglUseFontBitmapsA
151 # define wglUseFontOutlines wglUseFontOutlinesA
152 # endif /* !UNICODE */
153 #endif /* _GNU_H_WINDOWS32_FUNCTIONS */
154 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR
, *PLAYERPLANEDESCRIPTOR
, *LPLAYERPLANEDESCRIPTOR
;
155 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT
, *PGLYPHMETRICSFLOAT
, *LPGLYPHMETRICSFLOAT
;
156 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR
, *PPIXELFORMATDESCRIPTOR
, *LPPIXELFORMATDESCRIPTOR
;
157 #include <gl/mesa_wgl.h>
163 /* Make sure we include glext.h */
164 #define GL_GLEXT_PROTOTYPES
166 #include "GL/glext.h"
170 /* Disable unreachable code warnings for Watcom C++ */
172 #pragma disable_message(201)
176 /* Turn off macro checking systems used by other libraries */
182 /* Create a macro so that asm functions can be linked into compilers other
186 #if !defined( __GNUC__ ) && !defined( VMS )
187 #define _ASMAPI __cdecl
191 #ifdef PTR_DECL_IN_FRONT
192 #define _ASMAPIP * _ASMAPI
194 #define _ASMAPIP _ASMAPI *
199 #define _NORMAPI _ASMAPI
200 #define _NORMAPIP _ASMAPIP
208 #endif /* GLHEADER_H */