Add GLAPIENTRY function decorations for correct operation on Windows.
[mesa.git] / src / mesa / main / dispatch.c
1
2 /*
3 * Mesa 3-D graphics library
4 * Version: 4.1
5 *
6 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions 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 MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26
27 /*
28 * This file generates all the gl* function entyrpoints.
29 * But if we're using X86-optimized dispatch (X86/glapi_x86.S) then
30 * we don't use this code.
31 *
32 * NOTE: This file should _not_ be used when compiling Mesa for a DRI-
33 * based device driver.
34 *
35 */
36
37
38 #include "glheader.h"
39 #include "glapi.h"
40 #include "glapitable.h"
41 #include "glthread.h"
42
43
44 #if !(defined(USE_X86_ASM) || defined(USE_SPARC_ASM))
45
46 #if defined(WIN32)
47 #define KEYWORD1 GLAPI
48 #else
49 #define KEYWORD1
50 #endif
51
52 #define KEYWORD2 GLAPIENTRY
53
54 #if defined(USE_MGL_NAMESPACE)
55 #define NAME(func) mgl##func
56 #else
57 #define NAME(func) gl##func
58 #endif
59
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 (_glapi_Dispatch->FUNC) ARGS;
67
68 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
69 fprintf MESSAGE; \
70 return (_glapi_Dispatch->FUNC) ARGS
71
72 #else
73
74 #define DISPATCH(FUNC, ARGS, MESSAGE) \
75 (_glapi_Dispatch->FUNC) ARGS;
76
77 #define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
78 return (_glapi_Dispatch->FUNC) ARGS
79
80 #endif /* logging */
81
82
83 #ifndef GLAPIENTRY
84 #define GLAPIENTRY
85 #endif
86
87 #include "glapitemp.h"
88
89
90 #endif /* USE_X86_ASM */