osmesa: Fix missing symbols when GLX_INDIRECT_RENDERING is defined.
authorJeremy Huddleston <jeremyhu@apple.com>
Tue, 7 Jun 2011 04:51:18 +0000 (00:51 -0400)
committerJeremy Huddleston <jeremyhu@apple.com>
Wed, 8 Jun 2011 06:06:37 +0000 (23:06 -0700)
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@apple.com>
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
src/mesa/drivers/osmesa/osmesa.c

index 68d711446428b76f0da5554f60ea48c3535ffd25..4e6d5b69d573803ba6fcfbed50fe091bfbfe79bc 100644 (file)
@@ -1553,3 +1553,31 @@ 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 */