blob: 34127cb248ad07a84d21491ccf7c7585e8be73fa [file] [log] [blame]
Brian Paulfbd8f211999-11-11 01:22:25 +00001/*
2 * Mesa 3-D graphics library
Brian Paul11364122004-11-27 03:47:14 +00003 * Version: 6.3
Brian Paulfbd8f211999-11-11 01:22:25 +00004 *
Brian Paul11364122004-11-27 03:47:14 +00005 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
Brian Paulfbd8f211999-11-11 01:22:25 +00006 *
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 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25
Ian Romanicka657c1a2005-04-07 23:58:51 +000026/**
27 * \file dispatch.c
Brian Paula02fb6a2000-02-02 19:34:08 +000028 *
Ian Romanicka657c1a2005-04-07 23:58:51 +000029 * This file generates all the gl* function entrypoints. This code is not
30 * used if optimized assembly stubs are available (e.g., using x86/glapi_x86.S
31 * on IA32 or sparc/glapi_sparc.S on SPARC).
Brian Paula02fb6a2000-02-02 19:34:08 +000032 *
Ian Romanicka657c1a2005-04-07 23:58:51 +000033 * \note
34 * This file is also used to build the client-side libGL that loads DRI-based
35 * device drivers. At build-time it is symlinked to src/glx/x11.
36 *
37 * \author Brian Paul <brian@precisioninsight.com>
Brian Paula02fb6a2000-02-02 19:34:08 +000038 */
39
Ian Romanicka657c1a2005-04-07 23:58:51 +000040#ifndef GLX_USE_APPLEGL
Brian Paula02fb6a2000-02-02 19:34:08 +000041
Brian Paulbbd28712008-09-18 12:26:54 -060042#include "main/glheader.h"
43#include "glapi/glapi.h"
44#include "glapi/glapitable.h"
45#include "glapi/glthread.h"
Brian Paul3c634522002-10-24 23:57:19 +000046
Brian Paulfbd8f211999-11-11 01:22:25 +000047
Ian Romanickf0ff50d2005-07-02 08:29:57 +000048#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
Brian Paul59577b51999-11-27 21:40:28 +000049
Brian Paul04120f62001-09-14 22:19:18 +000050#if defined(WIN32)
51#define KEYWORD1 GLAPI
52#else
Brian Paul819b5192004-11-27 17:30:41 +000053#define KEYWORD1 PUBLIC
Brian Paul04120f62001-09-14 22:19:18 +000054#endif
55
Brian Paul01c07132000-01-28 19:02:57 +000056#define KEYWORD2 GLAPIENTRY
Brian Paul04120f62001-09-14 22:19:18 +000057
Brian Paul3c257e12001-03-28 17:19:58 +000058#if defined(USE_MGL_NAMESPACE)
Brian Paul01c07132000-01-28 19:02:57 +000059#define NAME(func) mgl##func
60#else
61#define NAME(func) gl##func
62#endif
63
Brian Paul4e9676f2002-06-29 19:48:15 +000064#if 0 /* Use this to log GL calls to stdout (for DEBUG only!) */
Brian Paul471a7742001-12-04 23:43:31 +000065
66#define F stdout
Brian Paul3c257e12001-03-28 17:19:58 +000067#define DISPATCH(FUNC, ARGS, MESSAGE) \
Brian Paulb15a3b42001-12-15 16:42:59 +000068 fprintf MESSAGE; \
Ian Romanick9bdfee32005-07-18 12:31:24 +000069 CALL_ ## FUNC(GET_DISPATCH(), ARGS);
Brian Paulb15a3b42001-12-15 16:42:59 +000070
71#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
72 fprintf MESSAGE; \
Ian Romanick9bdfee32005-07-18 12:31:24 +000073 return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
Brian Paul471a7742001-12-04 23:43:31 +000074
75#else
76
77#define DISPATCH(FUNC, ARGS, MESSAGE) \
Ian Romanick9bdfee32005-07-18 12:31:24 +000078 CALL_ ## FUNC(GET_DISPATCH(), ARGS);
Brian Paul471a7742001-12-04 23:43:31 +000079
Brian Paul3c257e12001-03-28 17:19:58 +000080#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) \
Ian Romanick9bdfee32005-07-18 12:31:24 +000081 return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
Brian Paul01c07132000-01-28 19:02:57 +000082
Brian Paulb15a3b42001-12-15 16:42:59 +000083#endif /* logging */
84
Brian Paul01c07132000-01-28 19:02:57 +000085
86#ifndef GLAPIENTRY
87#define GLAPIENTRY
88#endif
89
Brian Paulbbd28712008-09-18 12:26:54 -060090#include "glapi/dispatch.h"
91#include "glapi/glapitemp.h"
Brian Paul3c257e12001-03-28 17:19:58 +000092
Brian Paul3c257e12001-03-28 17:19:58 +000093#endif /* USE_X86_ASM */
Ian Romanicka657c1a2005-04-07 23:58:51 +000094
95#endif /* !GLX_USE_APPLEGL */