Advertisement

Current WIP (rev 383) doesn't compile with AS_MAX_PORTABILITY

Started by March 24, 2009 09:59 AM
9 comments, last by SiCrane 15 years, 8 months ago
I tried playing around with aswrappedcall.h some, and there seems to be two issues with the implementation. First one is that the macro doesn't handle overloaded functions. A set of macros like asFUNCTION(), asFUNCTIONPR(), etc. seems to handle this:
#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.

This topic is closed to new replies.

Advertisement