aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorivan-matveev <[email protected]>2022-08-22 19:21:58 +0300
committerPaul Adenot <[email protected]>2022-09-06 14:38:56 +0200
commitd93c82fdd28c681fd1579944cc1c240d242c4c4b (patch)
tree469ee37774fadc2f18866aa546fec5944ff82c87
parentdc511c6b3597b6384d28949285b9289e009830ea (diff)
downloadcubeb-d93c82fdd28c681fd1579944cc1c240d242c4c4b.tar.gz
cubeb-d93c82fdd28c681fd1579944cc1c240d242c4c4b.zip
Add #ifndef around dlclose() to allow build with "LAZY_LOAD_LIBS=OFF" cmake argument.
-rw-r--r--src/cubeb_aaudio.cpp3
-rw-r--r--src/cubeb_alsa.c4
-rw-r--r--src/cubeb_jack.cpp4
-rw-r--r--src/cubeb_pulse.c3
-rw-r--r--src/cubeb_sndio.c2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/cubeb_aaudio.cpp b/src/cubeb_aaudio.cpp
index 6076f1d..9aecb9b 100644
--- a/src/cubeb_aaudio.cpp
+++ b/src/cubeb_aaudio.cpp
@@ -463,10 +463,11 @@ aaudio_destroy(cubeb * ctx)
if (ctx->state.notifier.joinable()) {
ctx->state.notifier.join();
}
-
+#ifndef DISABLE_LIBAAUDIO_DLOPEN
if (ctx->libaaudio) {
dlclose(ctx->libaaudio);
}
+#endif // #ifndef DISABLE_LIBAAUDIO_DLOPEN
delete ctx;
}
diff --git a/src/cubeb_alsa.c b/src/cubeb_alsa.c
index b1464d1..a5a2f54 100644
--- a/src/cubeb_alsa.c
+++ b/src/cubeb_alsa.c
@@ -957,11 +957,11 @@ alsa_destroy(cubeb * ctx)
WRAP(snd_config_delete)(ctx->local_config);
pthread_mutex_unlock(&cubeb_alsa_mutex);
}
-
+#ifndef DISABLE_LIBASOUND_DLOPEN
if (ctx->libasound) {
dlclose(ctx->libasound);
}
-
+#endif // DISABLE_LIBASOUND_DLOPEN
free(ctx);
}
diff --git a/src/cubeb_jack.cpp b/src/cubeb_jack.cpp
index 3b3056c..28ca67c 100644
--- a/src/cubeb_jack.cpp
+++ b/src/cubeb_jack.cpp
@@ -788,10 +788,10 @@ cbjack_destroy(cubeb * context)
if (context->jack_client != NULL)
WRAP(jack_client_close)(context->jack_client);
-
+#ifndef DISABLE_LIBJACK_DLOPEN
if (context->libjack)
dlclose(context->libjack);
-
+#endif // DISABLE_LIBJACK_DLOPEN
free(context);
}
diff --git a/src/cubeb_pulse.c b/src/cubeb_pulse.c
index 13f6791..7fc4d6b 100644
--- a/src/cubeb_pulse.c
+++ b/src/cubeb_pulse.c
@@ -804,10 +804,11 @@ pulse_destroy(cubeb * ctx)
if (ctx->device_ids) {
cubeb_strings_destroy(ctx->device_ids);
}
-
+#ifndef DISABLE_LIBPULSE_DLOPEN
if (ctx->libpulse) {
dlclose(ctx->libpulse);
}
+#endif // DISABLE_LIBPULSE_DLOPEN
free(ctx->default_sink_info);
free(ctx);
}
diff --git a/src/cubeb_sndio.c b/src/cubeb_sndio.c
index 5e11725..0a78220 100644
--- a/src/cubeb_sndio.c
+++ b/src/cubeb_sndio.c
@@ -362,8 +362,10 @@ static void
sndio_destroy(cubeb * context)
{
DPR("sndio_destroy()\n");
+#ifndef DISABLE_LIBSNDIO_DLOPEN
if (context->libsndio)
dlclose(context->libsndio);
+#endif // DISABLE_LIBSNDIO_DLOPEN
free(context);
}