diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-04-23 10:18:32 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-04-23 10:18:32 +0000 |
commit | d6cf125d942e332f7d3d043310831d0ba95ce0af (patch) | |
tree | bbf6d5048433426fd805cd6dfcaab2885d9ac718 /libvo/gl_common.c | |
parent | e3f02a93cc764b93382e7fbcfa3c3eaa94181de3 (diff) | |
download | mpv-d6cf125d942e332f7d3d043310831d0ba95ce0af.tar.bz2 mpv-d6cf125d942e332f7d3d043310831d0ba95ce0af.tar.xz |
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).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29224 b3059339-0415-0410-9bf9-f77b7e298cf2
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 596f99c0b9..b89c7fac07 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1536,22 +1536,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; } /** |