diff options
Diffstat (limited to 'core/dbus_wrap.cpp')
-rw-r--r-- | core/dbus_wrap.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/dbus_wrap.cpp b/core/dbus_wrap.cpp index 08020c9b..05d9fc06 100644 --- a/core/dbus_wrap.cpp +++ b/core/dbus_wrap.cpp @@ -8,7 +8,6 @@ #include <mutex> #include <type_traits> -#include "albit.h" #include "logging.h" @@ -16,8 +15,15 @@ void PrepareDBus() { const char *libname{"libdbus-1.so.3"}; + dbus_handle = LoadLib(libname); + if(!dbus_handle) + { + WARN("Failed to load %s\n", libname); + return; + } + auto load_func = [](auto &f, const char *name) -> void - { f = al::bit_cast<std::remove_reference_t<decltype(f)>>(GetSymbol(dbus_handle, name)); }; + { f = reinterpret_cast<std::remove_reference_t<decltype(f)>>(GetSymbol(dbus_handle, name)); }; #define LOAD_FUNC(x) do { \ load_func(p##x, #x); \ if(!p##x) \ @@ -29,14 +35,8 @@ void PrepareDBus() } \ } while(0); - dbus_handle = LoadLib(libname); - if(!dbus_handle) - { - WARN("Failed to load %s\n", libname); - return; - } + DBUS_FUNCTIONS(LOAD_FUNC) -DBUS_FUNCTIONS(LOAD_FUNC) #undef LOAD_FUNC } #endif |