Skip to content

Commit

Permalink
Removed dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenpanne committed May 12, 2016
1 parent 8c038e3 commit c26b4ee
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions cbits/HsGLUT.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,40 +42,6 @@ hs_GLUT_getProcAddress(const char *name)
return handle ? GetProcAddress(handle, name) : NULL;
}

/* -------------------------------------------------------------------------- */
#elif defined(USE_NSADDRESSOFSYMBOL)

#include <mach-o/dyld.h>
#include <stdlib.h>
#include <string.h>

void*
hs_GLUT_getProcAddress(const char *name)
{
NSSymbol symbol;

/* Prepend a '_' for the Unix C symbol mangling convention */
char* symbolName = (char*)malloc(strlen(name) + 2);
if (!symbolName) {
return NULL;
}
symbolName[0] = '_';
strcpy(symbolName + 1, name);

if (!NSIsSymbolNameDefined(symbolName)) {
free(symbolName);
return NULL;
}

symbol = NSLookupAndBindSymbol(symbolName);
free(symbolName);
if (!symbol) {
return NULL;
}

return NSAddressOfSymbol(symbol);
}

/* -------------------------------------------------------------------------- */
#elif defined(USE_DLSYM)

Expand Down

0 comments on commit c26b4ee

Please sign in to comment.