]> git.alsa-project.org Git - alsa-lib.git/commitdiff
core: Proper reference of internal snd_dlopen()
authorTakashi Iwai <tiwai@suse.de>
Thu, 4 Jan 2018 14:26:33 +0000 (15:26 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 4 Jan 2018 14:29:57 +0000 (15:29 +0100)
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>
include/local.h
src/conf.c
src/dlmisc.c
src/hwdep/hwdep.c
src/mixer/simple_abst.c
src/pcm/pcm_hooks.c
src/pcm/pcm_meter.c
src/rawmidi/rawmidi.c
src/seq/seq.c
src/timer/timer.c
src/timer/timer_query.c

index f338d520f6ef3aeefd7c3be8ba2c06fab49ab598..b5e7b6f00ff5fa7d4ac1f70256f516c8547d4fc7 100644 (file)
@@ -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
index e71bb972015bcd877e7e6959ff8c4bbae6c3e979..254c485868b58342ec56fff995f003b188fc9b88 100644 (file)
@@ -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;
index b10aef4d53743453e70af3297bf3d4248c4a08f0..3757d331b8b205d3c93f937bf3686124d51acc26 100644 (file)
@@ -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) {
index 7aa475c02e9069b5b247e296fd11ce744066b89e..c5b3513da647b001af964494cb3c61ae825d7228 100644 (file)
@@ -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;
index 32a3f621f70c4da24906f8ba6b4ee7a72c0881f3..9c61cb58f3b207d112e08065c355d9ef0ef229e0 100644 (file)
@@ -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);
index 1f08bd78d5dd23a15a7285863085ff00ab18913d..4416d3631748c3641fa4ff8132076ad989418fa1 100644 (file)
@@ -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) {
index 75df09ca7ed36bf90744270399e35a2507f33fcb..20b41876d86806c32ac728ad28cc3be1a2964dd2 100644 (file)
@@ -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) {
index 88d43017fd18bec6ee4f82c7f337b4c532cf0ce0..2f419142b9b58bdc2c22f90392470fc6a8c83170 100644 (file)
@@ -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;
index 983c4fab9ba69bd41b62602a2b70fb5f14dbb503..c6a1ad155bfbcb9d9785f25bea1822430763e3e7 100644 (file)
@@ -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;
index 8c49737e859cd36f830fd9c48d2e9dcad2d5b341..a96a81178602b6342b3d2fcb410a4e6ec260ab07 100644 (file)
@@ -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;
index 6739f3c4109b0f8accbc399a0d5404a3fb95ab7c..0e046df963320f81933adc4b0b21e35f7e5dbcf8 100644 (file)
@@ -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;