Can't use automatic wrapper functions from AngelScript, C++ build fails

71 views Asked by At

I'm trying to compile Amnesia: The Dark Descent videogame engine for an obscure processor architecture. I've managed to build and launch game successfully, but the game crashes while loading the first level. Log file implies, that this function from AngelScript bindings always fails. I've stumbled across this bug which seems like the same problem that I'm having. There, a solution is suggested, to use automatic wrapper functions. But when I replace (in the function mentioned above)

if(mpScriptEngine->RegisterGlobalFunction(asFuncDecl.c_str(),asFUNCTION(pFunc),asCALL_STDCALL)<0)

with

if(mpScriptEngine->RegisterGlobalFunction(asFuncDecl.c_str(),WRAP_FN(pFunc),asCALL_GENERIC)<0)

I get the following errors:

the value of parameter "pFunc" (declared at line 462) cannot be used as a constant if(mpScriptEngine->RegisterGlobalFunction(asFuncDecl.c_str(),WRAP_FN(pFunc),asCALL_GENERIC)<0)

no instance of function template "gw::Id::f [with T=void *]" matches the argument list object type is: gw::Id<void *> #define WRAP_FN(name) (::gw::id(name).TMPL f< name >())

Can this be fixed without completely reworking the way the engine registers scripts?

It should be noted, that this engine must be built against AngelScript 2.19 (newer versions are confirmed to be working on the platform I'm using).

0

There are 0 answers