prepend underscore before passing symbols to dlsym, at least on OS X

svn-id: r10328
This commit is contained in:
Max Horn 2003-09-20 01:08:08 +00:00
parent 7d95a33922
commit bfbc6ed39a

View File

@ -155,6 +155,13 @@ public:
void *DynamicPlugin::findSymbol(const char *symbol) {
#ifdef UNIX
#ifdef MACOSX
// Need to prepend underscore on Mac OS X
char buffer[256];
buffer[0] = '_';
strcpy(buffer + 1, symbol);
symbol = buffer;
#endif
void *func = dlsym(_dlHandle, symbol);
if (!func)
warning("Failed loading symbold '%s' from plugin '%s' (%s)", symbol, _filename.c_str(), dlerror());