aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2024-01-03 14:58:07 -0800
committerChris Robinson <[email protected]>2024-01-03 14:58:07 -0800
commit18349e1da2c79d0f41c8c4f12ccd065f91618a6f (patch)
tree43124b48b1542f9049d20a01f0c625a954b96510 /core
parente90075031dfeec7ff03d5d1c5e319e7472312f46 (diff)
Avoid using bit_cast for pointer types
Diffstat (limited to 'core')
-rw-r--r--core/dbus_wrap.cpp18
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