mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
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 <tiwai@suse.de>
This commit is contained in:
parent
f19d9575b0
commit
de52ee3bb6
11 changed files with 17 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <math.h>
|
||||
#include <dlfcn.h>
|
||||
#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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue