Browse Source

Updated glLoadGen-generated files.

Includes fix described on https://bitbucket.org/alfonse/glloadgen/issue/29/compilation-errors-on-mac-os-x ,
which fixes warnings related to conversion and deprecated API on OS X.
pull/34/head
Vladimír Vondruš 13 years ago
parent
commit
ebe691e87f
  1. 24
      external/OpenGL/GL/gl_magnum.c

24
external/OpenGL/GL/gl_magnum.c vendored

@ -4,27 +4,15 @@
#include "gl_magnum.h" #include "gl_magnum.h"
#if defined(__APPLE__) #if defined(__APPLE__)
#include <mach-o/dyld.h> #include <dlfcn.h>
static void* AppleGLGetProcAddress (const GLubyte *name) static void* AppleGLGetProcAddress (const char *name)
{ {
static const struct mach_header* image = NULL; static void* image = NULL;
NSSymbol symbol;
char* symbolName;
if (NULL == image) if (NULL == image)
{ image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
} return image ? dlsym(image, name) : NULL;
/* 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;
} }
#endif /* __APPLE__ */ #endif /* __APPLE__ */

Loading…
Cancel
Save