diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp index 448ea918..76e2544b 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 08772dd9..b1464d15 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 35902353..e6d948f1 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 31a2f93d..438a695e 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 d7fb7920..5e11725e 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) \