Kaydet (Commit) 6bb92c5e authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Make sure IMPL_STATIC_LINK's type matches Link::pFunc's type

...to avoid -fsanitize=function warnings in Link::Call.

Change-Id: I837b35bd3052716fbb41bf4f893961257d1f9b2c
üst 358d6006
......@@ -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 ) \
......
......@@ -33,6 +33,7 @@
#include <sfx2/sfxuno.hxx>
#include <cppuhelper/compbase4.hxx>
#include <sfx2/dllapi.h>
#include <tools/link.hxx>
class ResMgr;
namespace sfx2
......@@ -125,7 +126,8 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase
void StartFileDialog();
sfx2::FileDialogHelper* GetFileDialog() const { return m_pFileDlg; }
static long DialogClosedHdl_Impl( ShutdownIcon*, sfx2::FileDialogHelper* );
DECL_STATIC_LINK(
ShutdownIcon, DialogClosedHdl_Impl, sfx2::FileDialogHelper*);
static bool IsQuickstarterInstalled();
......
......@@ -3262,7 +3262,7 @@ const NfCurrencyEntry* SvNumberFormatter::GetLegacyOnlyCurrencyEntry( const OUSt
// static
IMPL_STATIC_LINK_NOINSTANCE( SvNumberFormatter, CurrencyChangeLink, SAL_UNUSED_PARAMETER void*, EMPTYARG )
IMPL_STATIC_LINK_NOINSTANCE_NOARG( SvNumberFormatter, CurrencyChangeLink )
{
::osl::MutexGuard aGuard( GetMutex() );
OUString aAbbrev;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment