AngelScript datetime addon compilation error

Started by
1 comment, last by WitchLord 2 years, 7 months ago

Hi, I'm trying to compile AngelScript with a few addons and I'm having trouble with the datetime one on macOS with clang (tried both 7 and 11). This is using the latest AngelScript head (from the GitHub mirror).

angelscript/sdk/add_on/datetime/datetime.cpp:277:89: error: no matching function for call to 'asFunctionPtr'
                r = engine->RegisterObjectMethod("datetime", "int64 opSub(const datetime &in) const", WRAP_MFN_PR(CDateTime, operator-, (const CDateTime &other) const, asINT64), asCALL_GENERIC); assert(r >= 0);
                                                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
angelscript/sdk/add_on/datetime/../autowrapper/aswrappedcall.h:568:62: note: expanded from macro 'WRAP_MFN_PR'
#define WRAP_MFN_PR(ClassType, name, Parameters, ReturnType) asFUNCTION((::gw::Wrapper<ReturnType (ClassType::*)Parameters>::TMPL f< AS_METHOD_AMBIGUITY_CAST(ReturnType (ClassType::*)Parameters)(&ClassType::name) >))
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
angelscript/sdk/angelscript/include/angelscript.h:424:23: note: expanded from macro 'asFUNCTION'
#define asFUNCTION(f) asFunctionPtr(f)
                      ^~~~~~~~~~~~~
angelscript/sdk/angelscript/include/angelscript.h:1200:19: note: candidate template ignored: couldn't infer template argument 'T'
inline asSFuncPtr asFunctionPtr(T func)
                  ^

I'm not sure if this is due to some missing class I'm not adding, but I'll appreciate any help I can get with this.

Thanks in advance!

Advertisement

I think this is a problem with WRAP_MFN_PR, and not datetime.

Can you check how AS_METHOD_AMBIGUITY_CAST and TMPL are evaluated in the preprocessor?

These are compiler specific and may need to be tweaked for macOS with clang similar to how they are set for other compilers in angelscript.h and aswrappedcall.h. Unfortunately I do not have an environment to try this myself so I would need your help to figure out the solution.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement