[Piglit] [PATCH 05/10] piglit-dispatch: only use glXGetProcAddressARB if PIGLIT_HAS_GLX

Daniel Kurtz djkurtz at chromium.org
Wed Jan 15 03:10:00 PST 2014


If there is no GLX, then there is no glXGetProcAddressARB to call and the
library can't link.

Returning NULL for the proc address might cause some tests to crash - but
they shouldn't they be using waffle anyway for EGL dispatch?

Signed-off-by: Daniel Kurtz <djkurtz at chromium.org>
---
 tests/util/piglit-dispatch-init.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/util/piglit-dispatch-init.c b/tests/util/piglit-dispatch-init.c
index 8984815..936005b 100644
--- a/tests/util/piglit-dispatch-init.c
+++ b/tests/util/piglit-dispatch-init.c
@@ -33,7 +33,9 @@
 
 #else /* Linux */
 
+#ifdef PIGLIT_HAS_GLX
 #include "glxew.h"
+#endif
 
 #endif
 
@@ -143,7 +145,12 @@ get_core_proc_address(const char *function_name, int gl_10x_version)
 static piglit_dispatch_function_ptr
 get_ext_proc_address(const char *function_name)
 {
+#ifdef PIGLIT_HAS_GLX
 	return glXGetProcAddressARB((const GLubyte *) function_name);
+#else
+	(void)function_name;
+	return (piglit_dispatch_function_ptr)NULL;
+#endif
 }
 
 /**
-- 
1.8.5.2



More information about the Piglit mailing list