Don't assert for unexpected FX slot IDs
[openal-soft.git] / core / dbus_wrap.cpp
blob05d9fc0638a8f4f4e9cb5176f2ac3b5722f502f6
2 #include "config.h"
4 #include "dbus_wrap.h"
6 #ifdef HAVE_DYNLOAD
8 #include <mutex>
9 #include <type_traits>
11 #include "logging.h"
14 void PrepareDBus()
16 const char *libname{"libdbus-1.so.3"};
18 dbus_handle = LoadLib(libname);
19 if(!dbus_handle)
21 WARN("Failed to load %s\n", libname);
22 return;
25 auto load_func = [](auto &f, const char *name) -> void
26 { f = reinterpret_cast<std::remove_reference_t<decltype(f)>>(GetSymbol(dbus_handle, name)); };
27 #define LOAD_FUNC(x) do { \
28 load_func(p##x, #x); \
29 if(!p##x) \
30 { \
31 WARN("Failed to load function %s\n", #x); \
32 CloseLib(dbus_handle); \
33 dbus_handle = nullptr; \
34 return; \
35 } \
36 } while(0);
38 DBUS_FUNCTIONS(LOAD_FUNC)
40 #undef LOAD_FUNC
42 #endif