diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-02-02 00:20:57 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-02-02 00:20:57 +0100 |
commit | e0fd99b911eb3a7ca5590f0d7504f181a6f8c0f4 (patch) | |
tree | 467774f6f4cce87a99d95b709aa2a1fe79201760 /src/pulsecore/ltdl-helper.c | |
parent | b092f2e0f8686d78ceccac07bea4b7d2e327fb67 (diff) |
work around dlsym() return value mistyping as suggested in POSIX
Diffstat (limited to 'src/pulsecore/ltdl-helper.c')
-rw-r--r-- | src/pulsecore/ltdl-helper.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulsecore/ltdl-helper.c b/src/pulsecore/ltdl-helper.c index 0d4c22f8..ed0b63af 100644 --- a/src/pulsecore/ltdl-helper.c +++ b/src/pulsecore/ltdl-helper.c @@ -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(symbol); - if ((f = ((pa_void_func_t) (size_t) lt_dlsym(handle, symbol)))) + *(void**) &f = lt_dlsym(handle, symbol); + + if (f) return f; 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)) *c = '_'; - f = (pa_void_func_t) (size_t) lt_dlsym(handle, sn); + *(void**) &f = lt_dlsym(handle, sn); pa_xfree(sn); return f; |