OSDN Git Service

7f80562429c9299d19275011c65353d5d72ac1d0
[android-x86/external-mesa.git] / src / mapi / glapi / glapi_dispatch.c
1 /*
2  * Mesa 3-D graphics library
3  * Version:  6.3
4  *
5  * Copyright (C) 1999-2004  Brian Paul   All Rights Reserved.
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a
8  * copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation
10  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11  * and/or sell copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included
15  * in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23  * OTHER DEALINGS IN THE SOFTWARE.
24  */
25
26
27 /**
28  * \file glapi_dispatch.c
29  *
30  * This file generates all the gl* function entrypoints.  This code is not
31  * used if optimized assembly stubs are available (e.g., using
32  * glapi/glapi_x86.S on IA32 or glapi/glapi_sparc.S on SPARC).
33  *
34  * \note
35  * This file is also used to build the client-side libGL that loads DRI-based
36  * device drivers.  At build-time it is symlinked to src/glx.
37  *
38  * \author Brian Paul <brian@precisioninsight.com>
39  */
40
41 #include "glapi/glapi_priv.h"
42 #include "glapi/glapitable.h"
43
44
45 #if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
46
47 #if defined(_WIN32)
48 #define KEYWORD1 GLAPI
49 #else
50 #define KEYWORD1 PUBLIC
51 #endif
52
53 #define KEYWORD2 GLAPIENTRY
54
55 #if defined(USE_MGL_NAMESPACE)
56 #define NAME(func)  mgl##func
57 #else
58 #define NAME(func)  gl##func
59 #endif
60
61 #if 0  /* Use this to log GL calls to stdout (for DEBUG only!) */
62
63 #define F stdout
64 #define DISPATCH(FUNC, ARGS, MESSAGE)           \
65    fprintf MESSAGE;                             \
66    GET_DISPATCH()->FUNC ARGS
67
68 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE)    \
69    fprintf MESSAGE;                             \
70    return GET_DISPATCH()->FUNC ARGS
71
72 #else
73
74 #define DISPATCH(FUNC, ARGS, MESSAGE)           \
75    GET_DISPATCH()->FUNC ARGS
76
77 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE)    \
78    return GET_DISPATCH()->FUNC ARGS
79
80 #endif /* logging */
81
82
83 #ifndef GLAPIENTRY
84 #define GLAPIENTRY
85 #endif
86
87 #ifdef GLX_INDIRECT_RENDERING
88 /* those link to libglapi.a should provide the entry points */
89 #define _GLAPI_SKIP_PROTO_ENTRY_POINTS
90 #endif
91 #include "glapi/glapitemp.h"
92
93 #endif /* USE_X86_ASM */