Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Unified Diff: third_party/glew/src/glew.c

Issue 256037: Ported Chrome's WebGL implementation to Mac OS X. Removed code which... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/glew/README.chromium ('k') | webkit/api/src/GraphicsContext3D.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/glew/src/glew.c
===================================================================
--- third_party/glew/src/glew.c (revision 27788)
+++ third_party/glew/src/glew.c (working copy)
@@ -66,29 +66,18 @@
#endif /* GLEW_MX */
#if defined(__APPLE__)
-#include <mach-o/dyld.h>
+#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
void* NSGLGetProcAddress (const GLubyte *name)
{
- static const struct mach_header* image = NULL;
- NSSymbol symbol;
- char* symbolName;
+ static void* image = NULL;
if (NULL == image)
{
- image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY | RTLD_LOCAL);
}
- /* prepend a '_' for the Unix C symbol mangling convention */
- symbolName = malloc(strlen((const char*)name) + 2);
- strcpy(symbolName+1, (const char*)name);
- symbolName[0] = '_';
- symbol = NULL;
- /* if (NSIsSymbolNameDefined(symbolName))
- symbol = NSLookupAndBindSymbol(symbolName); */
- symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
- free(symbolName);
- return symbol ? NSAddressOfSymbol(symbol) : NULL;
+ return image ? dlsym(image, (const char*) name) : NULL;
}
#endif /* __APPLE__ */
« no previous file with comments | « third_party/glew/README.chromium ('k') | webkit/api/src/GraphicsContext3D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698