work around dlsym() return value mistyping as suggested in POSIX

This commit is contained in:
Lennart Poettering 2009-02-02 00:20:57 +01:00
parent b092f2e0f8
commit e0fd99b911

View file

@ -42,7 +42,9 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
pa_assert(handle); pa_assert(handle);
pa_assert(symbol); pa_assert(symbol);
if ((f = ((pa_void_func_t) (size_t) lt_dlsym(handle, symbol)))) *(void**) &f = lt_dlsym(handle, symbol);
if (f)
return f; return f;
if (!module) if (!module)
@ -57,7 +59,7 @@ pa_void_func_t pa_load_sym(lt_dlhandle handle, const char *module, const char *s
if (!isalnum(*c)) if (!isalnum(*c))
*c = '_'; *c = '_';
f = (pa_void_func_t) (size_t) lt_dlsym(handle, sn); *(void**) &f = lt_dlsym(handle, sn);
pa_xfree(sn); pa_xfree(sn);
return f; return f;