[Mesa-dev] [PATCH] osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.

Jeremy Huddleston jeremyhu at apple.com
Mon Jun 6 21:51:18 PDT 2011


When GLX_INDIRECT_RENDERING is defined, some symbols are used in
libglapi.a but are not defined.  Define them through the help of
glapitemp.h.

Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
Signed-off-by: Chia-I Wu <olvaffe at gmail.com>
---

Please see my previous post for discussion.  This patch fixes the build as discussed in that post, but I'd still like to better understand what is going on here and the underlying reason for why this hack is needed.

Changes originally by Chia-I Wu in 6678f597e7c9ba784c9af0c86cfc6821558bcaa7 and 888429360a30090b9ecd17bfd160a88141195235

 src/mesa/drivers/osmesa/osmesa.c |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 68d7114..025a3df 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1553,3 +1553,32 @@ OSMesaColorClamp(GLboolean enable)
 }
 
 
+/**
+ * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in
+ * libglapi.a.  We need to define them here.
+ */
+#ifdef GLX_INDIRECT_RENDERING
+
+#define GL_GLEXT_PROTOTYPES
+#include "GL/gl.h"
+#include "glapi/glapi.h"
+#include "glapi/glapitable.h"
+
+#if defined(USE_MGL_NAMESPACE)
+#define NAME(func)  mgl##func
+#else
+#define NAME(func)  gl##func
+#endif
+
+#define DISPATCH(FUNC, ARGS, MESSAGE)		\
+   GET_DISPATCH()->FUNC ARGS
+
+#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE) 	\
+   return GET_DISPATCH()->FUNC ARGS
+
+/* skip normal ones */
+#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS
+#include "glapi/glapitemp.h"
+
+#endif /* GLX_INDIRECT_RENDERING */
+
-- 
1.7.5.4




More information about the mesa-dev mailing list