summaryrefslogtreecommitdiff
path: root/include/tools/link.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-30 18:24:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-30 18:30:40 +0200
commit6bb92c5eaf1ff2f5292442870c65bfe2771752ec (patch)
tree0e1d73d1f0597e1ada3c860276f0c9dc9cd22349 /include/tools/link.hxx
parent358d6006f1d9652aaf01661ea8dba4d7ec46d508 (diff)
Make sure IMPL_STATIC_LINK's type matches Link::pFunc's type
...to avoid -fsanitize=function warnings in Link::Call. Change-Id: I837b35bd3052716fbb41bf4f893961257d1f9b2c
Diffstat (limited to 'include/tools/link.hxx')
-rw-r--r--include/tools/link.hxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/tools/link.hxx b/include/tools/link.hxx
index 951422203581..c603c0ea707e 100644
--- a/include/tools/link.hxx
+++ b/include/tools/link.hxx
@@ -31,6 +31,7 @@ typedef long (*PSTUB)( void*, void* );
static long LinkStub##Method( void* pThis, void* )
#define DECL_STATIC_LINK( Class, Method, ArgType ) \
+ static long LinkStub##Method( void* pThis, void* ); \
static long Method( Class*, ArgType )
#define DECL_DLLPRIVATE_LINK(Method, ArgType) \
@@ -38,6 +39,7 @@ typedef long (*PSTUB)( void*, void* );
SAL_DLLPRIVATE static long LinkStub##Method(void * pThis, void *)
#define DECL_DLLPRIVATE_STATIC_LINK(Class, Method, ArgType) \
+ SAL_DLLPRIVATE static long LinkStub##Method( void* pThis, void* ); \
SAL_DLLPRIVATE static long Method(Class *, ArgType)
#define IMPL_STUB(Class, Method, ArgType) \
@@ -47,16 +49,30 @@ typedef long (*PSTUB)( void*, void* );
}
#define IMPL_STATIC_LINK( Class, Method, ArgType, ArgName ) \
+ long Class::LinkStub##Method( void* pThis, void* pCaller) \
+ { \
+ return Method( (Class*)pThis, (ArgType)pCaller ); \
+ } \
long Class::Method( Class* pThis, ArgType ArgName )
#define IMPL_STATIC_LINK_NOINSTANCE( Class, Method, ArgType, ArgName ) \
+ long Class::LinkStub##Method( void* pThis, void* pCaller) \
+ { \
+ return Method( (Class*)pThis, (ArgType)pCaller ); \
+ } \
long Class::Method( SAL_UNUSED_PARAMETER Class*, ArgType ArgName )
+#define IMPL_STATIC_LINK_NOINSTANCE_NOARG( Class, Method ) \
+ long Class::LinkStub##Method( void* pThis, void* pCaller) \
+ { \
+ return Method( (Class*)pThis, pCaller ); \
+ } \
+ long Class::Method( SAL_UNUSED_PARAMETER Class*, SAL_UNUSED_PARAMETER void* )
+
#define LINK( Inst, Class, Member ) \
Link( (Class*)Inst, (PSTUB)&Class::LinkStub##Member )
-#define STATIC_LINK( Inst, Class, Member ) \
- Link( (Class*)Inst, (PSTUB)&Class::Member )
+#define STATIC_LINK( Inst, Class, Member ) LINK(Inst, Class, Member)
#define IMPL_LINK( Class, Method, ArgType, ArgName ) \
IMPL_STUB( Class, Method, ArgType ) \