# HG changeset patch # User reimar # Date 1240481912 0 # Node ID edd77b4f699b757deb5d1349dee14ee2c1a9c53d # Parent ecb3c5f2fdd1a038fd96db1093d55f5e98d7f1ca Change getdladdr to always use dlopen, dlsym and then dlclose. Performance is not really important and dlsym(0, ...) is not defined while the more correct dlsym(RTLD_DEFAULT, ...) is a GNUism (although POSIX does reserve RTLD_DEFAULT). diff -r ecb3c5f2fdd1 -r edd77b4f699b libvo/gl_common.c --- a/libvo/gl_common.c Thu Apr 23 08:46:05 2009 +0000 +++ b/libvo/gl_common.c Thu Apr 23 10:18:32 2009 +0000 @@ -1536,22 +1536,17 @@ * \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); + return NULL; + ret = dlsym(handle, s); + dlclose(handle); #endif -#else - return NULL; -#endif + return ret; } /**