Advertisement

FYI: asFUNCTION() w\ template arguments on GCC

Started by May 27, 2009 01:45 PM
0 comments, last by WitchLord 15 years, 9 months ago
Just thought you'd like to know WitchLord, in the manual on this page: http://www.angelcode.com/angelscript/sdk/docs/manual/index.html You show using a templated function to do reference casting, but on MinGW/GCC 4.1.2 it produces a compile time error:

    r = engine->RegisterGlobalBehaviour(asBEHAVE_IMPLICIT_REF_CAST, "Base@ f( Child@ )", asFUNCTION(refCastNoRelease<Child,Base>), asCALL_CDECL); assert( r >= 0 );

Quote:
error: macro "asFUNCTION" passed 2 arguments, but takes just 1
Although it is easily fixed by surounding the macro argument with parens:

    r = engine->RegisterGlobalBehaviour(asBEHAVE_IMPLICIT_REF_CAST, "Base@ f( Child@ )", asFUNCTION((refCastNoRelease<Child,Base>)), asCALL_CDECL); assert( r >= 0 );

==============================
A Developers Blog | Dark Rock Studios - My Site
Thanks. I'll make sure to update the manual.

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