summaryrefslogtreecommitdiff
path: root/lib/interception
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-10-16 08:20:31 +0000
committerAlexey Samsonov <samsonov@google.com>2013-10-16 08:20:31 +0000
commit5e2d3776a314629680921abd1d55d89d95a2da90 (patch)
tree86524a10e4ad7c9d05e8006cb67f822f283c2a1a /lib/interception
parente852e41d345c4be4ca28962cbc6c6d59717759c7 (diff)
downloadcompiler-rt-5e2d3776a314629680921abd1d55d89d95a2da90.tar.gz
Make some pthread_mutex_* and pthread_cond_* interceptors common.
Reviewers: eugenis, dvyukov Reviewed By: dvyukov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1937 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception')
-rw-r--r--lib/interception/interception.h6
-rw-r--r--lib/interception/interception_linux.h9
-rw-r--r--lib/interception/interception_mac.h1
-rw-r--r--lib/interception/interception_win.h3
4 files changed, 16 insertions, 3 deletions
diff --git a/lib/interception/interception.h b/lib/interception/interception.h
index cc8d7b0d2..baddd6c13 100644
--- a/lib/interception/interception.h
+++ b/lib/interception/interception.h
@@ -238,12 +238,18 @@ typedef unsigned long uptr; // NOLINT
#if defined(__linux__)
# include "interception_linux.h"
# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX(func)
+# define INTERCEPT_FUNCTION_VER(func, symver) \
+ INTERCEPT_FUNCTION_VER_LINUX(func, symver)
#elif defined(__APPLE__)
# include "interception_mac.h"
# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_MAC(func)
+# define INTERCEPT_FUNCTION_VER(func, symver) \
+ INTERCEPT_FUNCTION_VER_MAC(func, symver)
#else // defined(_WIN32)
# include "interception_win.h"
# define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_WIN(func)
+# define INTERCEPT_FUNCTION_VER(func, symver) \
+ INTERCEPT_FUNCTION_VER_WIN(func, symver)
#endif
#undef INCLUDED_FROM_INTERCEPTION_LIB
diff --git a/lib/interception/interception_linux.h b/lib/interception/interception_linux.h
index 8f7a706fc..b2f74d105 100644
--- a/lib/interception/interception_linux.h
+++ b/lib/interception/interception_linux.h
@@ -35,9 +35,12 @@ void *GetFuncAddrVer(const char *func_name, const char *ver);
(::__interception::uptr)&WRAP(func))
#if !defined(__ANDROID__) // android does not have dlvsym
-#define INTERCEPT_FUNCTION_VER(func, symver) \
- ::__interception::real_##func = (func##_f)(unsigned long) \
- ::__interception::GetFuncAddrVer(#func, #symver)
+# 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
diff --git a/lib/interception/interception_mac.h b/lib/interception/interception_mac.h
index 505948983..e5a35c697 100644
--- a/lib/interception/interception_mac.h
+++ b/lib/interception/interception_mac.h
@@ -22,6 +22,7 @@
#define INTERCEPTION_MAC_H
#define INTERCEPT_FUNCTION_MAC(func)
+#define INTERCEPT_FUNCTION_VER_MAC(func, symver)
#endif // INTERCEPTION_MAC_H
#endif // __APPLE__
diff --git a/lib/interception/interception_win.h b/lib/interception/interception_win.h
index c64af1baf..f2727c924 100644
--- a/lib/interception/interception_win.h
+++ b/lib/interception/interception_win.h
@@ -41,5 +41,8 @@ bool OverrideFunction(uptr old_func, uptr new_func, uptr *orig_old_func);
(::__interception::uptr*)&REAL(func))
#endif
+#define INTERCEPT_FUNCTION_VER_WIN(func, symver) \
+ INTERCEPT_FUNCTION_WIN(func)
+
#endif // INTERCEPTION_WIN_H
#endif // _WIN32