sourcehook/test/testhookmangen.h
branchhookman_autogen
changeset 466 c733f5be0e5d
parent 465 c86a55fbcd88
child 467 7b0d972632af
     1.1 --- a/sourcehook/test/testhookmangen.h	Sun Nov 18 15:08:03 2007 +0000
     1.2 +++ b/sourcehook/test/testhookmangen.h	Mon Nov 19 13:39:44 2007 +0000
     1.3 @@ -638,6 +638,57 @@
     1.4  	bool TestClass##id::ms_DoRecall = false; \
     1.5  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
     1.6  
     1.7 +#define THGM_MAKE_TEST0_vafmt(id, ret_type) \
     1.8 +	struct TestClass##id; \
     1.9 +	typedef ret_type RetType##id; \
    1.10 +	typedef ParamState1<0, std::string > ParamState_m##id; \
    1.11 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
    1.12 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
    1.13 +	\
    1.14 +	struct TestClass##id \
    1.15 +	{ \
    1.16 +		static bool ms_DoRecall; \
    1.17 +		\
    1.18 +		virtual ret_type Func(const char *fmt, ...) \
    1.19 +		{ \
    1.20 +			g_Inside_LeafFunc = true; \
    1.21 +			\
    1.22 +			char buf[9999]; \
    1.23 +			va_list ap; \
    1.24 +			va_start(ap, fmt); \
    1.25 +			vsnprintf(buf, 9998, fmt, ap); \
    1.26 +			buf[9998] = 0; \
    1.27 +			va_end(ap); \
    1.28 +			\
    1.29 +			ADD_STATE(State_Func##id(this, ParamState_m##id(std::string(buf)))); \
    1.30 +			\
    1.31 +			return MakeRet< ret_type >::Do(0); \
    1.32 +		} \
    1.33 +		\
    1.34 +		struct Delegate : public MyDelegate \
    1.35 +		{ \
    1.36 +			int m_DelegNumber; \
    1.37 +			Delegate(int num) : m_DelegNumber(num) { } \
    1.38 +			\
    1.39 +			virtual ret_type Call(const char *buf) \
    1.40 +			{ \
    1.41 +				g_Inside_LeafFunc = true; \
    1.42 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(buf))); \
    1.43 +				g_Inside_LeafFunc = false; \
    1.44 +				if (ms_DoRecall) \
    1.45 +				{ \
    1.46 +					 \
    1.47 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, ("%s!", buf)); \
    1.48 +				} \
    1.49 +				else \
    1.50 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
    1.51 +			} \
    1.52 +		}; \
    1.53 +	}; \
    1.54 +	\
    1.55 +	bool TestClass##id::ms_DoRecall = false; \
    1.56 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
    1.57 +
    1.58  #define THGM_SETUP_PI0(id) \
    1.59  	void setuppi_##id() \
    1.60  	{ \
    1.61 @@ -781,6 +832,57 @@
    1.62  	bool TestClass##id::ms_DoRecall = false; \
    1.63  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
    1.64  
    1.65 +#define THGM_MAKE_TEST1_vafmt(id, ret_type, param1) \
    1.66 +	struct TestClass##id; \
    1.67 +	typedef ret_type RetType##id; \
    1.68 +	typedef ParamState2<0, param1, std::string > ParamState_m##id; \
    1.69 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
    1.70 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
    1.71 +	\
    1.72 +	struct TestClass##id \
    1.73 +	{ \
    1.74 +		static bool ms_DoRecall; \
    1.75 +		\
    1.76 +		virtual ret_type Func(param1 p1, const char *fmt, ...) \
    1.77 +		{ \
    1.78 +			g_Inside_LeafFunc = true; \
    1.79 +			\
    1.80 +			char buf[9999]; \
    1.81 +			va_list ap; \
    1.82 +			va_start(ap, fmt); \
    1.83 +			vsnprintf(buf, 9998, fmt, ap); \
    1.84 +			buf[9998] = 0; \
    1.85 +			va_end(ap); \
    1.86 +			\
    1.87 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, std::string(buf)))); \
    1.88 +			\
    1.89 +			return MakeRet< ret_type >::Do(0); \
    1.90 +		} \
    1.91 +		\
    1.92 +		struct Delegate : public MyDelegate \
    1.93 +		{ \
    1.94 +			int m_DelegNumber; \
    1.95 +			Delegate(int num) : m_DelegNumber(num) { } \
    1.96 +			\
    1.97 +			virtual ret_type Call(param1 p1, const char *buf) \
    1.98 +			{ \
    1.99 +				g_Inside_LeafFunc = true; \
   1.100 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, buf))); \
   1.101 +				g_Inside_LeafFunc = false; \
   1.102 +				if (ms_DoRecall) \
   1.103 +				{ \
   1.104 +					Increment<StripRef< param1 >::type>::Incr(p1); \
   1.105 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, "%s!", buf)); \
   1.106 +				} \
   1.107 +				else \
   1.108 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.109 +			} \
   1.110 +		}; \
   1.111 +	}; \
   1.112 +	\
   1.113 +	bool TestClass##id::ms_DoRecall = false; \
   1.114 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.115 +
   1.116  #define THGM_SETUP_PI1(id, p1_type, p1_passtype, p1_flags) \
   1.117  	void setuppi_##id() \
   1.118  	{ \
   1.119 @@ -931,6 +1033,57 @@
   1.120  	bool TestClass##id::ms_DoRecall = false; \
   1.121  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.122  
   1.123 +#define THGM_MAKE_TEST2_vafmt(id, ret_type, param1, param2) \
   1.124 +	struct TestClass##id; \
   1.125 +	typedef ret_type RetType##id; \
   1.126 +	typedef ParamState3<0, param1, param2, std::string > ParamState_m##id; \
   1.127 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.128 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.129 +	\
   1.130 +	struct TestClass##id \
   1.131 +	{ \
   1.132 +		static bool ms_DoRecall; \
   1.133 +		\
   1.134 +		virtual ret_type Func(param1 p1, param2 p2, const char *fmt, ...) \
   1.135 +		{ \
   1.136 +			g_Inside_LeafFunc = true; \
   1.137 +			\
   1.138 +			char buf[9999]; \
   1.139 +			va_list ap; \
   1.140 +			va_start(ap, fmt); \
   1.141 +			vsnprintf(buf, 9998, fmt, ap); \
   1.142 +			buf[9998] = 0; \
   1.143 +			va_end(ap); \
   1.144 +			\
   1.145 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, std::string(buf)))); \
   1.146 +			\
   1.147 +			return MakeRet< ret_type >::Do(0); \
   1.148 +		} \
   1.149 +		\
   1.150 +		struct Delegate : public MyDelegate \
   1.151 +		{ \
   1.152 +			int m_DelegNumber; \
   1.153 +			Delegate(int num) : m_DelegNumber(num) { } \
   1.154 +			\
   1.155 +			virtual ret_type Call(param1 p1, param2 p2, const char *buf) \
   1.156 +			{ \
   1.157 +				g_Inside_LeafFunc = true; \
   1.158 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, buf))); \
   1.159 +				g_Inside_LeafFunc = false; \
   1.160 +				if (ms_DoRecall) \
   1.161 +				{ \
   1.162 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2); \
   1.163 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, p2, "%s!", buf)); \
   1.164 +				} \
   1.165 +				else \
   1.166 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.167 +			} \
   1.168 +		}; \
   1.169 +	}; \
   1.170 +	\
   1.171 +	bool TestClass##id::ms_DoRecall = false; \
   1.172 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.173 +
   1.174  #define THGM_SETUP_PI2(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags) \
   1.175  	void setuppi_##id() \
   1.176  	{ \
   1.177 @@ -1088,6 +1241,57 @@
   1.178  	bool TestClass##id::ms_DoRecall = false; \
   1.179  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.180  
   1.181 +#define THGM_MAKE_TEST3_vafmt(id, ret_type, param1, param2, param3) \
   1.182 +	struct TestClass##id; \
   1.183 +	typedef ret_type RetType##id; \
   1.184 +	typedef ParamState4<0, param1, param2, param3, std::string > ParamState_m##id; \
   1.185 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.186 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.187 +	\
   1.188 +	struct TestClass##id \
   1.189 +	{ \
   1.190 +		static bool ms_DoRecall; \
   1.191 +		\
   1.192 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, const char *fmt, ...) \
   1.193 +		{ \
   1.194 +			g_Inside_LeafFunc = true; \
   1.195 +			\
   1.196 +			char buf[9999]; \
   1.197 +			va_list ap; \
   1.198 +			va_start(ap, fmt); \
   1.199 +			vsnprintf(buf, 9998, fmt, ap); \
   1.200 +			buf[9998] = 0; \
   1.201 +			va_end(ap); \
   1.202 +			\
   1.203 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, std::string(buf)))); \
   1.204 +			\
   1.205 +			return MakeRet< ret_type >::Do(0); \
   1.206 +		} \
   1.207 +		\
   1.208 +		struct Delegate : public MyDelegate \
   1.209 +		{ \
   1.210 +			int m_DelegNumber; \
   1.211 +			Delegate(int num) : m_DelegNumber(num) { } \
   1.212 +			\
   1.213 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, const char *buf) \
   1.214 +			{ \
   1.215 +				g_Inside_LeafFunc = true; \
   1.216 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, buf))); \
   1.217 +				g_Inside_LeafFunc = false; \
   1.218 +				if (ms_DoRecall) \
   1.219 +				{ \
   1.220 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3); \
   1.221 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, p2, p3, "%s!", buf)); \
   1.222 +				} \
   1.223 +				else \
   1.224 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.225 +			} \
   1.226 +		}; \
   1.227 +	}; \
   1.228 +	\
   1.229 +	bool TestClass##id::ms_DoRecall = false; \
   1.230 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.231 +
   1.232  #define THGM_SETUP_PI3(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags) \
   1.233  	void setuppi_##id() \
   1.234  	{ \
   1.235 @@ -1252,6 +1456,57 @@
   1.236  	bool TestClass##id::ms_DoRecall = false; \
   1.237  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.238  
   1.239 +#define THGM_MAKE_TEST4_vafmt(id, ret_type, param1, param2, param3, param4) \
   1.240 +	struct TestClass##id; \
   1.241 +	typedef ret_type RetType##id; \
   1.242 +	typedef ParamState5<0, param1, param2, param3, param4, std::string > ParamState_m##id; \
   1.243 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.244 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.245 +	\
   1.246 +	struct TestClass##id \
   1.247 +	{ \
   1.248 +		static bool ms_DoRecall; \
   1.249 +		\
   1.250 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, const char *fmt, ...) \
   1.251 +		{ \
   1.252 +			g_Inside_LeafFunc = true; \
   1.253 +			\
   1.254 +			char buf[9999]; \
   1.255 +			va_list ap; \
   1.256 +			va_start(ap, fmt); \
   1.257 +			vsnprintf(buf, 9998, fmt, ap); \
   1.258 +			buf[9998] = 0; \
   1.259 +			va_end(ap); \
   1.260 +			\
   1.261 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, std::string(buf)))); \
   1.262 +			\
   1.263 +			return MakeRet< ret_type >::Do(0); \
   1.264 +		} \
   1.265 +		\
   1.266 +		struct Delegate : public MyDelegate \
   1.267 +		{ \
   1.268 +			int m_DelegNumber; \
   1.269 +			Delegate(int num) : m_DelegNumber(num) { } \
   1.270 +			\
   1.271 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, const char *buf) \
   1.272 +			{ \
   1.273 +				g_Inside_LeafFunc = true; \
   1.274 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, buf))); \
   1.275 +				g_Inside_LeafFunc = false; \
   1.276 +				if (ms_DoRecall) \
   1.277 +				{ \
   1.278 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4); \
   1.279 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, p2, p3, p4, "%s!", buf)); \
   1.280 +				} \
   1.281 +				else \
   1.282 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.283 +			} \
   1.284 +		}; \
   1.285 +	}; \
   1.286 +	\
   1.287 +	bool TestClass##id::ms_DoRecall = false; \
   1.288 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.289 +
   1.290  #define THGM_SETUP_PI4(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags) \
   1.291  	void setuppi_##id() \
   1.292  	{ \
   1.293 @@ -1423,6 +1678,57 @@
   1.294  	bool TestClass##id::ms_DoRecall = false; \
   1.295  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.296  
   1.297 +#define THGM_MAKE_TEST5_vafmt(id, ret_type, param1, param2, param3, param4, param5) \
   1.298 +	struct TestClass##id; \
   1.299 +	typedef ret_type RetType##id; \
   1.300 +	typedef ParamState6<0, param1, param2, param3, param4, param5, std::string > ParamState_m##id; \
   1.301 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.302 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.303 +	\
   1.304 +	struct TestClass##id \
   1.305 +	{ \
   1.306 +		static bool ms_DoRecall; \
   1.307 +		\
   1.308 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *fmt, ...) \
   1.309 +		{ \
   1.310 +			g_Inside_LeafFunc = true; \
   1.311 +			\
   1.312 +			char buf[9999]; \
   1.313 +			va_list ap; \
   1.314 +			va_start(ap, fmt); \
   1.315 +			vsnprintf(buf, 9998, fmt, ap); \
   1.316 +			buf[9998] = 0; \
   1.317 +			va_end(ap); \
   1.318 +			\
   1.319 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, std::string(buf)))); \
   1.320 +			\
   1.321 +			return MakeRet< ret_type >::Do(0); \
   1.322 +		} \
   1.323 +		\
   1.324 +		struct Delegate : public MyDelegate \
   1.325 +		{ \
   1.326 +			int m_DelegNumber; \
   1.327 +			Delegate(int num) : m_DelegNumber(num) { } \
   1.328 +			\
   1.329 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, const char *buf) \
   1.330 +			{ \
   1.331 +				g_Inside_LeafFunc = true; \
   1.332 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, buf))); \
   1.333 +				g_Inside_LeafFunc = false; \
   1.334 +				if (ms_DoRecall) \
   1.335 +				{ \
   1.336 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5); \
   1.337 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, p2, p3, p4, p5, "%s!", buf)); \
   1.338 +				} \
   1.339 +				else \
   1.340 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.341 +			} \
   1.342 +		}; \
   1.343 +	}; \
   1.344 +	\
   1.345 +	bool TestClass##id::ms_DoRecall = false; \
   1.346 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.347 +
   1.348  #define THGM_SETUP_PI5(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags, p5_type, p5_passtype, p5_flags) \
   1.349  	void setuppi_##id() \
   1.350  	{ \
   1.351 @@ -1601,6 +1907,57 @@
   1.352  	bool TestClass##id::ms_DoRecall = false; \
   1.353  	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall | SourceHook::ProtoInfo::CallConv_HasVafmt);
   1.354  
   1.355 +#define THGM_MAKE_TEST6_vafmt(id, ret_type, param1, param2, param3, param4, param5, param6) \
   1.356 +	struct TestClass##id; \
   1.357 +	typedef ret_type RetType##id; \
   1.358 +	typedef ParamState7<0, param1, param2, param3, param4, param5, param6, std::string > ParamState_m##id; \
   1.359 +	MAKE_STATE_2(State_Func##id, TestClass##id* /*thisptr*/, ParamState_m##id ); \
   1.360 +	MAKE_STATE_4(State_Deleg_##id, int /*delegnumber*/, TestClass##id* /*ifptr*/, int /*deleg thisptr*/, ParamState_m##id ); \
   1.361 +	\
   1.362 +	struct TestClass##id \
   1.363 +	{ \
   1.364 +		static bool ms_DoRecall; \
   1.365 +		\
   1.366 +		virtual ret_type Func(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *fmt, ...) \
   1.367 +		{ \
   1.368 +			g_Inside_LeafFunc = true; \
   1.369 +			\
   1.370 +			char buf[9999]; \
   1.371 +			va_list ap; \
   1.372 +			va_start(ap, fmt); \
   1.373 +			vsnprintf(buf, 9998, fmt, ap); \
   1.374 +			buf[9998] = 0; \
   1.375 +			va_end(ap); \
   1.376 +			\
   1.377 +			ADD_STATE(State_Func##id(this, ParamState_m##id(p1, p2, p3, p4, p5, p6, std::string(buf)))); \
   1.378 +			\
   1.379 +			return MakeRet< ret_type >::Do(0); \
   1.380 +		} \
   1.381 +		\
   1.382 +		struct Delegate : public MyDelegate \
   1.383 +		{ \
   1.384 +			int m_DelegNumber; \
   1.385 +			Delegate(int num) : m_DelegNumber(num) { } \
   1.386 +			\
   1.387 +			virtual ret_type Call(param1 p1, param2 p2, param3 p3, param4 p4, param5 p5, param6 p6, const char *buf) \
   1.388 +			{ \
   1.389 +				g_Inside_LeafFunc = true; \
   1.390 +				ADD_STATE(State_Deleg_##id(m_DelegNumber, META_IFACEPTR(TestClass##id), PtrBuf(this), ParamState_m##id(p1, p2, p3, p4, p5, p6, buf))); \
   1.391 +				g_Inside_LeafFunc = false; \
   1.392 +				if (ms_DoRecall) \
   1.393 +				{ \
   1.394 +					Increment<StripRef< param1 >::type>::Incr(p1);Increment<StripRef< param2 >::type>::Incr(p2);Increment<StripRef< param3 >::type>::Incr(p3);Increment<StripRef< param4 >::type>::Incr(p4);Increment<StripRef< param5 >::type>::Incr(p5);Increment<StripRef< param6 >::type>::Incr(p6); \
   1.395 +					RETURN_META_VALUE_NEWPARAMS((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber), &TestClass##id::Func, (p1, p2, p3, p4, p5, p6, "%s!", buf)); \
   1.396 +				} \
   1.397 +				else \
   1.398 +					RETURN_META_VALUE((m_DelegNumber & 1) ? MRES_IGNORED : MRES_SUPERCEDE, MakeRet< ret_type >::Do(m_DelegNumber)); \
   1.399 +			} \
   1.400 +		}; \
   1.401 +	}; \
   1.402 +	\
   1.403 +	bool TestClass##id::ms_DoRecall = false; \
   1.404 +	SourceHook::CProtoInfoBuilder protoinfo_##id(SourceHook::ProtoInfo::CallConv_ThisCall);
   1.405 +
   1.406  #define THGM_SETUP_PI6(id, p1_type, p1_passtype, p1_flags, p2_type, p2_passtype, p2_flags, p3_type, p3_passtype, p3_flags, p4_type, p4_passtype, p4_flags, p5_type, p5_passtype, p5_flags, p6_type, p6_passtype, p6_flags) \
   1.407  	void setuppi_##id() \
   1.408  	{ \