diff options
Diffstat (limited to 'lib/interception/interception_linux.h')
-rw-r--r-- | lib/interception/interception_linux.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h index dba60bf7315e..cea957320d05 100644 --- a/lib/interception/interception_linux.h +++ b/lib/interception/interception_linux.h @@ -25,6 +25,7 @@ namespace __interception { // returns true if a function with the given name was found. bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, uptr real, uptr wrapper); +void *GetFuncAddrVer(const char *func_name, const char *ver); } // namespace __interception #define INTERCEPT_FUNCTION_LINUX(func) \ @@ -33,5 +34,14 @@ bool GetRealFunctionAddress(const char *func_name, uptr *func_addr, (::__interception::uptr)&(func), \ (::__interception::uptr)&WRAP(func)) +#if !defined(__ANDROID__) // android does not have dlvsym +# define INTERCEPT_FUNCTION_VER_LINUX(func, symver) \ + ::__interception::real_##func = (func##_f)(unsigned long) \ + ::__interception::GetFuncAddrVer(#func, symver) +#else +# define INTERCEPT_FUNCTION_VER_LINUX(func, symver) \ + INTERCEPT_FUNCTION_LINUX(func) +#endif // !defined(__ANDROID__) + #endif // INTERCEPTION_LINUX_H #endif // __linux__ |