From de52ee3bb6669e4771679ebdebc0a90978cb4f74 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 4 Jan 2018 15:26:33 +0100 Subject: [PATCH] core: Proper reference of internal snd_dlopen() snd_dlopen() was recently rewritten to be versioned symbols, and we have to call it with INTERNAL() wrapper from the library itself. Add the proper declaration in the local header and fix the callers appropriately. Signed-off-by: Takashi Iwai --- include/local.h | 4 ++++ src/conf.c | 4 ++-- src/dlmisc.c | 2 +- src/hwdep/hwdep.c | 2 +- src/mixer/simple_abst.c | 7 +++---- src/pcm/pcm_hooks.c | 2 +- src/pcm/pcm_meter.c | 2 +- src/rawmidi/rawmidi.c | 2 +- src/seq/seq.c | 2 +- src/timer/timer.c | 2 +- src/timer/timer_query.c | 2 +- 11 files changed, 17 insertions(+), 14 deletions(-) diff --git a/include/local.h b/include/local.h index f338d520..b5e7b6f0 100644 --- a/include/local.h +++ b/include/local.h @@ -361,4 +361,8 @@ int _snd_conf_generic_id(const char *id); const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#ifdef INTERNAL +void *INTERNAL(snd_dlopen)(const char *name, int mode, char *errbuf, size_t errbuflen); +#endif + #endif diff --git a/src/conf.c b/src/conf.c index e71bb972..254c4858 100644 --- a/src/conf.c +++ b/src/conf.c @@ -3538,7 +3538,7 @@ static int snd_config_hooks_call(snd_config_t *root, snd_config_t *config, snd_c buf[len-1] = '\0'; func_name = buf; } - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); func = h ? snd_dlsym(h, func_name, SND_DLSYM_VERSION(SND_CONFIG_DLSYM_VERSION_HOOK)) : NULL; err = 0; if (!h) { @@ -4531,7 +4531,7 @@ static int _snd_config_evaluate(snd_config_t *src, buf[len-1] = '\0'; func_name = buf; } - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) func = snd_dlsym(h, func_name, SND_DLSYM_VERSION(SND_CONFIG_DLSYM_VERSION_EVALUATE)); err = 0; diff --git a/src/dlmisc.c b/src/dlmisc.c index b10aef4d..3757d331 100644 --- a/src/dlmisc.c +++ b/src/dlmisc.c @@ -277,7 +277,7 @@ void *snd_dlobj_cache_get(const char *lib, const char *name, } errbuf[0] = '\0'; - dlobj = snd_dlopen(lib, RTLD_NOW, + dlobj = INTERNAL(snd_dlopen)(lib, RTLD_NOW, verbose ? errbuf : 0, verbose ? sizeof(errbuf) : 0); if (dlobj == NULL) { diff --git a/src/hwdep/hwdep.c b/src/hwdep/hwdep.c index 7aa475c0..c5b3513d 100644 --- a/src/hwdep/hwdep.c +++ b/src/hwdep/hwdep.c @@ -116,7 +116,7 @@ static int snd_hwdep_open_conf(snd_hwdep_t **hwdep, #ifndef PIC snd_hwdep_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_HWDEP_DLSYM_VERSION)); err = 0; diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c index 32a3f621..9c61cb58 100644 --- a/src/mixer/simple_abst.c +++ b/src/mixer/simple_abst.c @@ -35,8 +35,7 @@ #include #include #include -#include "config.h" -#include "asoundlib.h" +#include "mixer_local.h" #include "mixer_simple.h" #ifndef DOC_HIDDEN @@ -81,7 +80,7 @@ static int try_open(snd_mixer_class_t *class, const char *lib) strcpy(xlib, path); strcat(xlib, "/"); strcat(xlib, lib); - h = snd_dlopen(xlib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(xlib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h == NULL) { SNDERR("Unable to open library '%s' (%s)", xlib, errbuf); free(xlib); @@ -128,7 +127,7 @@ static int try_open_full(snd_mixer_class_t *class, snd_mixer_t *mixer, strcat(xlib, "/"); strcat(xlib, lib); /* note python modules requires RTLD_GLOBAL */ - h = snd_dlopen(xlib, RTLD_NOW|RTLD_GLOBAL, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(xlib, RTLD_NOW|RTLD_GLOBAL, errbuf, sizeof(errbuf)); if (h == NULL) { SNDERR("Unable to open library '%s'", xlib); free(xlib); diff --git a/src/pcm/pcm_hooks.c b/src/pcm/pcm_hooks.c index 1f08bd78..4416d363 100644 --- a/src/pcm/pcm_hooks.c +++ b/src/pcm/pcm_hooks.c @@ -424,7 +424,7 @@ static int snd_pcm_hook_add_conf(snd_pcm_t *pcm, snd_config_t *root, snd_config_ install = buf; snprintf(buf, sizeof(buf), "_snd_pcm_hook_%s_install", str); } - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); install_func = h ? snd_dlsym(h, install, SND_DLSYM_VERSION(SND_PCM_DLSYM_VERSION)) : NULL; err = 0; if (!h) { diff --git a/src/pcm/pcm_meter.c b/src/pcm/pcm_meter.c index 75df09ca..20b41876 100644 --- a/src/pcm/pcm_meter.c +++ b/src/pcm/pcm_meter.c @@ -670,7 +670,7 @@ static int snd_pcm_meter_add_scope_conf(snd_pcm_t *pcm, const char *name, open_name = buf; snprintf(buf, sizeof(buf), "_snd_pcm_scope_%s_open", str); } - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); open_func = h ? dlsym(h, open_name) : NULL; err = 0; if (!h) { diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c index 88d43017..2f419142 100644 --- a/src/rawmidi/rawmidi.c +++ b/src/rawmidi/rawmidi.c @@ -239,7 +239,7 @@ static int snd_rawmidi_open_conf(snd_rawmidi_t **inputp, snd_rawmidi_t **outputp #ifndef PIC snd_rawmidi_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_RAWMIDI_DLSYM_VERSION)); err = 0; diff --git a/src/seq/seq.c b/src/seq/seq.c index 983c4fab..c6a1ad15 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -899,7 +899,7 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name, #ifndef PIC snd_seq_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_SEQ_DLSYM_VERSION)); err = 0; diff --git a/src/timer/timer.c b/src/timer/timer.c index 8c49737e..a96a8117 100644 --- a/src/timer/timer.c +++ b/src/timer/timer.c @@ -150,7 +150,7 @@ static int snd_timer_open_conf(snd_timer_t **timer, #ifndef PIC snd_timer_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION)); err = 0; diff --git a/src/timer/timer_query.c b/src/timer/timer_query.c index 6739f3c4..0e046df9 100644 --- a/src/timer/timer_query.c +++ b/src/timer/timer_query.c @@ -108,7 +108,7 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer, #ifndef PIC snd_timer_query_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); + h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_QUERY_DLSYM_VERSION)); err = 0; -- 2.47.1