From d82c5c33a6ba5a1714678e0b0f21eb265b0eaab8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 11 Dec 2013 16:49:08 -0800 Subject: [PATCH] Fix the path to the GL library on OS X. --- src/dispatch_common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dispatch_common.c b/src/dispatch_common.c index ac92712..f24d090 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -113,6 +113,13 @@ struct api { /** dlopen() return value for libGL.so.1. */ void *glx_handle; + /** + * dlopen() return value for OS X's GL library. + * + * On linux, glx_handle is used instead. + */ + void *gl_handle; + /** dlopen() return value for libEGL.so.1 */ void *egl_handle; @@ -328,6 +335,10 @@ epoxy_gl_dlsym(const char *name) { #ifdef _WIN32 return GetProcAddress(LoadLibraryA("OPENGL32"), name); +#elif defined(__APPLE__) + return do_dlsym(&api.gl_handle, + "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", + name, true); #else /* There's no library for desktop GL support independent of GLX. */ return epoxy_glx_dlsym(name);