aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/plugins/PluginAPI.cpp
diff options
context:
space:
mode:
authorJan Beich <[email protected]>2023-03-31 19:39:04 +0000
committerGitHub <[email protected]>2023-03-31 20:39:04 +0100
commit16bc5997bb764a69433def368169a9f41a077dc6 (patch)
treeb460009ffbf5d8781513e76fae82ba71a13289c0 /src/plugins/PluginAPI.cpp
parent7680cd549c73c0bf57606d31fd6e5fd027458b72 (diff)
downloadHyprland-16bc5997bb764a69433def368169a9f41a077dc6.tar.gz
Hyprland-16bc5997bb764a69433def368169a9f41a077dc6.zip
Misc FreeBSD fixes (#1926)
* helpers: drop incomplete GNU/kFreeBSD bits Debian with FreeBSD kernel lacks Wayland-related packages and is not officially supported since Jessie. * KeybindManager: check VT ioctl availability instead of hardcoding * plugins: add missing header for libc++ after 430778293e4c src/plugins/PluginAPI.cpp:299:33: error: implicit instantiation of undefined template 'std::basic_istringstream<char>' std::istringstream inStream(SYMBOLS); ^ /usr/include/c++/v1/iosfwd:140:32: note: template is declared here class _LIBCPP_TEMPLATE_VIS basic_istringstream; ^ * plugins: prefer llvm-nm with Clang after 430778293e4c nm: invalid option -- j
Diffstat (limited to 'src/plugins/PluginAPI.cpp')
-rw-r--r--src/plugins/PluginAPI.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp
index 8a7e2565..f26c7b9d 100644
--- a/src/plugins/PluginAPI.cpp
+++ b/src/plugins/PluginAPI.cpp
@@ -7,6 +7,8 @@
#include <sys/sysctl.h>
#endif
+#include <sstream>
+
APICALL bool HyprlandAPI::registerCallbackStatic(HANDLE handle, const std::string& event, HOOK_CALLBACK_FN* fn) {
auto* const PLUGIN = g_pPluginSystem->getPluginByHandle(handle);
@@ -277,8 +279,13 @@ APICALL std::vector<SFunctionMatch> HyprlandAPI::findFunctionsByName(HANDLE hand
const auto FPATH = std::filesystem::canonical("/proc/self/exe");
#endif
+#ifdef __clang__
+ const auto SYMBOLS = execAndGet(("llvm-nm -D -j " + FPATH.string()).c_str());
+ const auto SYMBOLSDEMANGLED = execAndGet(("llvm-nm -D -j --demangle " + FPATH.string()).c_str());
+#else
const auto SYMBOLS = execAndGet(("nm -D -j " + FPATH.string()).c_str());
const auto SYMBOLSDEMANGLED = execAndGet(("nm -D -j --demangle=auto " + FPATH.string()).c_str());
+#endif
auto demangledFromID = [&](size_t id) -> std::string {
size_t pos = 0;