Skip to content

Commit

Permalink
[interception] Switch to _type suffix instead of _f, NFC.
Browse files Browse the repository at this point in the history
Some Darwin functions have pairs like dispatch_apply and dispatch_apply_f so the added _f to interceptor types causes a clash. Let's add _type suffix instead.

Differential Revision: https://reviews.llvm.org/D53167

llvm-svn: 344954
  • Loading branch information
kubamracek committed Oct 22, 2018
1 parent 2d7bde5 commit 975352c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/interception/interception.h
Expand Up @@ -170,7 +170,7 @@ const interpose_substitution substitution_##func_name[] \
#elif !SANITIZER_MAC
# define PTR_TO_REAL(x) real_##x
# define REAL(x) __interception::PTR_TO_REAL(x)
# define FUNC_TYPE(x) x##_f
# define FUNC_TYPE(x) x##_type

# define DECLARE_REAL(ret_type, func, ...) \
typedef ret_type (*FUNC_TYPE(func))(__VA_ARGS__); \
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/interception/interception_linux.h
Expand Up @@ -38,7 +38,7 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
// Android, Solaris and OpenBSD do not have dlvsym
#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
(::__interception::real_##func = (func##_f)( \
(::__interception::real_##func = (func##_type)( \
unsigned long)::__interception::GetFuncAddrVer(#func, symver))
#else
#define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
Expand Down

0 comments on commit 975352c

Please sign in to comment.