mirror of
https://github.com/yawut/SDL.git
synced 2026-04-21 16:17:28 -05:00
Moved otherwise-unused underscore-prepending code in dlopen backend into an
#ifdef. Fixes Bugzilla #354. --HG-- branch : SDL-1.2
This commit is contained in:
parent
9022fb1002
commit
ecb6de37d9
|
|
@ -45,12 +45,19 @@ void *SDL_LoadFunction(void *handle, const char *name)
|
|||
{
|
||||
void *symbol = dlsym(handle, name);
|
||||
if ( symbol == NULL ) {
|
||||
|
||||
#ifdef DLOPEN_NEED_UNDERSCORE
|
||||
/* append an underscore for platforms that need that. */
|
||||
size_t len = 1+SDL_strlen(name)+1;
|
||||
char *_name = SDL_stack_alloc(char, len);
|
||||
_name[0] = '_';
|
||||
SDL_strlcpy(&_name[1], name, len);
|
||||
symbol = dlsym(handle, name);
|
||||
symbol = dlsym(handle, _name);
|
||||
SDL_stack_free(_name);
|
||||
#else
|
||||
symbol = dlsym(handle, name);
|
||||
#endif
|
||||
|
||||
if ( symbol == NULL ) {
|
||||
SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user