diff options
author | Matthew Gregan <[email protected]> | 2021-11-04 16:01:25 +1300 |
---|---|---|
committer | Matthew Gregan <[email protected]> | 2021-11-10 08:49:30 +1300 |
commit | a4e701ff602eb38d12f24e6ea2424336b470e225 (patch) | |
tree | 9cc2f0fc0685f676b5da8f20586d9fbc1b7b6eef | |
parent | 07c352c65a95cb0ed44353859b83ee494458ca63 (diff) | |
download | cubeb-a4e701ff602eb38d12f24e6ea2424336b470e225.tar.gz cubeb-a4e701ff602eb38d12f24e6ea2424336b470e225.zip |
Tidy up `WRAP` definition for dlopen.
-rw-r--r-- | src/cubeb_aaudio.cpp | 2 | ||||
-rw-r--r-- | src/cubeb_alsa.c | 14 | ||||
-rw-r--r-- | src/cubeb_jack.cpp | 2 | ||||
-rw-r--r-- | src/cubeb_pulse.c | 2 | ||||
-rw-r--r-- | src/cubeb_sndio.c | 2 |
5 files changed, 7 insertions, 15 deletions
diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp index 448ea91..76e2544 100644 --- a/src/cubeb_aaudio.cpp +++ b/src/cubeb_aaudio.cpp @@ -24,7 +24,7 @@ #ifdef DISABLE_LIBAAUDIO_DLOPEN #define WRAP(x) x #else -#define WRAP(x) cubeb_##x +#define WRAP(x) (*cubeb_##x) #define LIBAAUDIO_API_VISIT(X) \ X(AAudio_convertResultToText) \ X(AAudio_convertStreamStateToText) \ diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c index 08772dd..b1464d1 100644 --- a/src/cubeb_alsa.c +++ b/src/cubeb_alsa.c @@ -22,7 +22,7 @@ #ifdef DISABLE_LIBASOUND_DLOPEN #define WRAP(x) x #else -#define WRAP(x) cubeb_##x +#define WRAP(x) (*cubeb_##x) #define LIBASOUND_API_VISIT(X) \ X(snd_config) \ X(snd_config_add) \ @@ -660,19 +660,11 @@ init_local_config_with_workaround(char const * pcm_name) lconf = NULL; - snd_config_t * gconf; - -#ifndef DISABLE_LIBASOUND_DLOPEN - gconf = *WRAP(snd_config); -#else - gconf = WRAP(snd_config); -#endif - - if (gconf == NULL) { + if (WRAP(snd_config) == NULL) { return NULL; } - r = WRAP(snd_config_copy)(&lconf, gconf); + r = WRAP(snd_config_copy)(&lconf, WRAP(snd_config)); if (r < 0) { return NULL; } diff --git a/src/cubeb_jack.cpp b/src/cubeb_jack.cpp index 3590235..e6d948f 100644 --- a/src/cubeb_jack.cpp +++ b/src/cubeb_jack.cpp @@ -29,7 +29,7 @@ #ifdef DISABLE_LIBJACK_DLOPEN #define WRAP(x) x #else -#define WRAP(x) api_##x +#define WRAP(x) (*api_##x) #define JACK_API_VISIT(X) \ X(jack_activate) \ X(jack_client_close) \ diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c index 31a2f93..438a695 100644 --- a/src/cubeb_pulse.c +++ b/src/cubeb_pulse.c @@ -19,7 +19,7 @@ #ifdef DISABLE_LIBPULSE_DLOPEN #define WRAP(x) x #else -#define WRAP(x) cubeb_##x +#define WRAP(x) (*cubeb_##x) #define LIBPULSE_API_VISIT(X) \ X(pa_channel_map_can_balance) \ X(pa_channel_map_init) \ diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c index d7fb792..5e11725 100644 --- a/src/cubeb_sndio.c +++ b/src/cubeb_sndio.c @@ -28,7 +28,7 @@ #ifdef DISABLE_LIBSNDIO_DLOPEN #define WRAP(x) x #else -#define WRAP(x) cubeb_##x +#define WRAP(x) (*cubeb_##x) #define LIBSNDIO_API_VISIT(X) \ X(sio_close) \ X(sio_eof) \ |