Stop using deprecated functions in Mac GrGLInterface setup
git-svn-id: http://skia.googlecode.com/svn/trunk@4109 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
index f34d1ba..d08d602 100644
--- a/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
+++ b/src/gpu/gl/mac/GrGLCreateNativeInterface_mac.cpp
@@ -13,20 +13,14 @@
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
-#include <mach-o/dyld.h>
+#include <dlfcn.h>
-
-// This uses deprecated functions, should rewrite using dlopen, dlsym, dlclose
void* GetProcAddress(const char* name) {
- NSSymbol symbol = NULL;
- if (NSIsSymbolNameDefined(name)) {
- symbol = NSLookupAndBindSymbol(name);
- }
- return NULL == symbol ? NULL : NSAddressOfSymbol(symbol);
+ return dlsym(RTLD_DEFAULT, name);
}
-#define GET_PROC(name) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("_gl" #name)))
-#define GET_PROC_SUFFIX(name, suffix) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("_gl" #name #suffix)))
+#define GET_PROC(name) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name)))
+#define GET_PROC_SUFFIX(name, suffix) (interface->f ## name = ((GrGL ## name ## Proc) GetProcAddress("gl" #name #suffix)))
const GrGLInterface* GrGLCreateNativeInterface() {
// The gl functions are not context-specific so we create one global