Use C++11 variadic templates for core-legacy FastDelegate.

This commit is contained in:
David Anderson 2015-10-24 18:48:24 -07:00
parent 2ce09bfa70
commit cf5550345c
6 changed files with 226 additions and 4028 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,5 @@
./shworker.bin iter sourcehook.hxx sourcehook.h $1
./shworker.bin iter sh_memfuncinfo.hxx sh_memfuncinfo.h $1
./shworker.bin hopter FastDelegate.hxx FastDelegate.h $1
cp *.h ..

View File

@ -5,6 +5,5 @@
shworker iter sourcehook.hxx sourcehook.h %1
shworker iter sh_memfuncinfo.hxx sh_memfuncinfo.h %1
shworker hopter FastDelegate.hxx FastDelegate.h %1
copy *.h ..
copy *.h ..

View File

@ -1191,7 +1191,7 @@ namespace SourceHook
#define SH_DECL_HOOK$1(ifacetype, ifacefunc, attr, overload, rettype@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN(ifacetype, ifacefunc, overload, (static_cast<rettype (ifacetype::*)(@[$2,1,$1|, :param$2@]) attr> \
(&ifacetype::ifacefunc))) \
typedef fastdelegate::FastDelegate$1<@[$2,1,$1|, :param$2@]@[$1!=0:, @]rettype> FD; \
typedef fastdelegate::FastDelegate<rettype@[$1!=0:, @]@[$2,1,$1|, :param$2@]> FD; \
virtual rettype Func(@[$2,1,$1|, :param$2 p$2@]) \
{ SH_HANDLEFUNC((@[$2,1,$1|, :param$2@]), (@[$2,1,$1|, :p$2@]), rettype); } \
SHINT_MAKE_GENERICSTUFF_END(ifacetype, ifacefunc, overload, \
@ -1204,7 +1204,7 @@ namespace SourceHook
#define SH_DECL_HOOK$1_void(ifacetype, ifacefunc, attr, overload@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN(ifacetype, ifacefunc, overload, (static_cast<void (ifacetype::*)(@[$2,1,$1|, :param$2@]) attr> \
(&ifacetype::ifacefunc))) \
typedef fastdelegate::FastDelegate$1<@[$2,1,$1|, :param$2@]> FD; \
typedef fastdelegate::FastDelegate<void@[$1!=0:, @]@[$2,1,$1|, :param$2@]> FD; \
virtual void Func(@[$2,1,$1|, :param$2 p$2@]) \
{ SH_HANDLEFUNC_void((@[$2,1,$1|, :param$2@]), (@[$2,1,$1|, :p$2@])); } \
SHINT_MAKE_GENERICSTUFF_END(ifacetype, ifacefunc, overload, \
@ -1218,7 +1218,7 @@ namespace SourceHook
#define SH_DECL_HOOK$1_vafmt(ifacetype, ifacefunc, attr, overload, rettype@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN(ifacetype, ifacefunc, overload, (static_cast<rettype (ifacetype::*)(@[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *, ...) attr> \
(&ifacetype::ifacefunc))) \
typedef fastdelegate::FastDelegate@($1+1)<@[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *, rettype> FD; \
typedef fastdelegate::FastDelegate<rettype, @[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *> FD; \
virtual rettype Func(@[$2,1,$1|, :param$2 p$2@]@[$1!=0:, @]const char *fmt, ...) \
{ \
char buf[::SourceHook::STRBUF_LEN]; \
@ -1238,7 +1238,7 @@ namespace SourceHook
#define SH_DECL_HOOK$1_void_vafmt(ifacetype, ifacefunc, attr, overload@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN(ifacetype, ifacefunc, overload, (static_cast<void (ifacetype::*)(@[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *, ...) attr> \
(&ifacetype::ifacefunc))) \
typedef fastdelegate::FastDelegate@($1+1)<@[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *> FD; \
typedef fastdelegate::FastDelegate<void, @[$2,1,$1|, :param$2@]@[$1!=0:, @]const char *> FD; \
virtual void Func(@[$2,1,$1|, :param$2 p$2@]@[$1!=0:, @]const char *fmt, ...) \
{ \
char buf[::SourceHook::STRBUF_LEN]; \
@ -1257,7 +1257,7 @@ namespace SourceHook
#define SH_DECL_MANUALHOOK$1(hookname, vtblidx, vtbloffs, thisptroffs, rettype@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN_MANUAL(hookname, vtbloffs, vtblidx, thisptroffs) \
typedef fastdelegate::FastDelegate$1<@[$2,1,$1|, :param$2@]@[$1!=0:, @]rettype> FD; \
typedef fastdelegate::FastDelegate<rettype@[$1!=0:, @]@[$2,1,$1|, :param$2@]> FD; \
virtual rettype Func(@[$2,1,$1|, :param$2 p$2@]) \
{ SH_HANDLEFUNC((@[$2,1,$1|, :param$2@]), (@[$2,1,$1|, :p$2@]), rettype); } \
typedef rettype(::SourceHook::EmptyClass::*ECMFP)(@[$2,1,$1|, :param$2@]); \
@ -1270,7 +1270,7 @@ namespace SourceHook
#define SH_DECL_MANUALHOOK$1_void(hookname, vtblidx, vtbloffs, thisptroffs@[$2,1,$1:, param$2@]) \
SHINT_MAKE_GENERICSTUFF_BEGIN_MANUAL(hookname, vtbloffs, vtblidx, thisptroffs) \
typedef fastdelegate::FastDelegate$1<@[$2,1,$1|, :param$2@]> FD; \
typedef fastdelegate::FastDelegate<void@[$1!=0:, @]@[$2,1,$1|, :param$2@]> FD; \
virtual void Func(@[$2,1,$1|, :param$2 p$2@]) \
{ SH_HANDLEFUNC_void((@[$2,1,$1|, :param$2@]), (@[$2,1,$1|, :p$2@])); } \
typedef void(::SourceHook::EmptyClass::*ECMFP)(@[$2,1,$1|, :param$2@]); \

File diff suppressed because it is too large Load Diff