diff --git a/lsplant/src/main/jni/include/utils/hook_helper.hpp b/lsplant/src/main/jni/include/utils/hook_helper.hpp index 935aa8110..09f83c684 100644 --- a/lsplant/src/main/jni/include/utils/hook_helper.hpp +++ b/lsplant/src/main/jni/include/utils/hook_helper.hpp @@ -49,7 +49,7 @@ template requires(std::is_same_v || std::is_same_v) inline auto memfun_cast(Return (*func)(T *, Args...)) { union { - Return (Class::*f)(Args...); + Return (Class::*f)(Args...) const; struct { decltype(func) p; @@ -145,7 +145,7 @@ struct MemberFunction { private: friend struct HookHandler; using ThisType = std::conditional_t, MemberFunction, This>; - Ret (ThisType::*function_)(Args...) = nullptr; + Ret (ThisType::*function_)(Args...) const = nullptr; }; template