Skip to content

Commit

Permalink
Tidy up WRAP definition for dlopen.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinetiknz committed Nov 9, 2021
1 parent 07c352c commit a4e701f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cubeb_aaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
14 changes: 3 additions & 11 deletions src/cubeb_alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cubeb_jack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion src/cubeb_pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion src/cubeb_sndio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit a4e701f

Please sign in to comment.