diff options
Diffstat (limited to 'libvo/gl_common.c')
-rw-r--r-- | libvo/gl_common.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index b65023f93e..950eb726f0 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1537,22 +1537,17 @@ void swapGlBuffers(void) { * \brief find address of a linked function * \param s name of function to find * \return address of function or NULL if not found - * - * Copied from xine */ static void *getdladdr(const char *s) { + void *ret = NULL; #ifdef HAVE_LIBDL -#if defined(__sun) || defined(__sgi) - static void *handle = NULL; + void *handle = dlopen(NULL, RTLD_LAZY); if (!handle) - handle = dlopen(NULL, RTLD_LAZY); - return dlsym(handle, s); -#else - return dlsym(0, s); -#endif -#else - return NULL; + return NULL; + ret = dlsym(handle, s); + dlclose(handle); #endif + return ret; } /** |