# HG changeset patch # User Ryan C. Gordon # Date 1170490305 0 # Node ID a813fff9416552566fdc6264614bd94913516d50 # Parent e3bf970d9494b9530a4e2e0ff3d1d88367f5d543 Moved otherwise-unused underscore-prepending code in dlopen backend into an #ifdef. Fixes Bugzilla #354. diff -r e3bf970d9494 -r a813fff94165 src/loadso/dlopen/SDL_sysloadso.c --- a/src/loadso/dlopen/SDL_sysloadso.c Tue Jan 23 04:47:11 2007 +0000 +++ b/src/loadso/dlopen/SDL_sysloadso.c Sat Feb 03 08:11:45 2007 +0000 @@ -45,12 +45,19 @@ { 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); + SDL_stack_free(_name); +#else symbol = dlsym(handle, name); - SDL_stack_free(_name); +#endif + if ( symbol == NULL ) { SDL_SetError("Failed loading %s: %s", name, (const char *)dlerror()); }