#define asFUNCTION_WRAPPER(wrapper_name, f) \ static void wrapper_name(asIScriptGeneric *gen) { \ asCallWrappedFunc(&f,gen);\ }#define asFUNCTIONPR_WRAPPER(wrapper_name, f, p, r) \ static void wrapper_name(asIScriptGeneric *gen) { \ asCallWrappedFunc((r (*)p)(&f),gen);\ }#define asMETHOD_WRAPPER(wrapper_name, c, m) \ static void wrapper_name(asIScriptGeneric *gen) { \ asCallWrappedFunc(&c::m,gen);\ }#define asMETHODPR_WRAPPER(wrapper_name, c, m, p, r) \ static void wrapper_name(asIScriptGeneric *gen) { \ asCallWrappedFunc((r (c::*)p)(&c::m),gen);\ }
The other issue is that the it doesn't handle const member functions, which just involves regenerating the member function calls with the const added in.
Also, I tried ripping out all the asNativeFuncPtr stuff and it seems to work the same under both MSVC and gcc 3.4.4, so I'm still not certain what it's for.