// // SqratGlobalMethods: Global Methods // // // Copyright (c) 2009 Brandon Jones // Copyirght 2011 Li-Cheng (Andy) Tai // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // #if !defined(_SCRAT_GLOBAL_METHODS_H_) #define _SCRAT_GLOBAL_METHODS_H_ #ifdef SQMOD_PLUGIN_API #include #else #include #endif // SQMOD_PLUGIN_API #include "sqratTypes.h" namespace Sqrat { /// @cond DEV // // Squirrel Global Functions // template class SqGlobal { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() R ret = (*method)(); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 1) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 3) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 4) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 5) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 6) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 7) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 8) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 9 template static SQInteger Func9(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 9) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 10 template static SQInteger Func10(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 10) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 11 template static SQInteger Func11(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 11) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 12 template static SQInteger Func12(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 12) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 13 template static SQInteger Func13(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 13) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 14 template static SQInteger Func14(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 14) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); Var a14(vm, startIdx + 13); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value, a14.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } }; // // reference return specialization // template class SqGlobal { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() R& ret = (*method)(); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 1) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 3) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 4) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 5) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 6) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 7) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 8) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 9 template static SQInteger Func9(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 9) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 10 template static SQInteger Func10(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 10) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 11 template static SQInteger Func11(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 11) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 12 template static SQInteger Func12(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 12) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 13 template static SQInteger Func13(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 13) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 14 template static SQInteger Func14(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 14) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); Var a14(vm, startIdx + 13); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value, a14.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } }; // // void return specialization // template <> class SqGlobal { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() (*method)(); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 1) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 3) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 4) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 5) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 6) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 7) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 8) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 9 template static SQInteger Func9(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 9) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 10 template static SQInteger Func10(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 10) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 11 template static SQInteger Func11(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 11) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 12 template static SQInteger Func12(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 12) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 13 template static SQInteger Func13(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 13) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 14 template static SQInteger Func14(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) != startIdx + 14) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); Var a9(vm, startIdx + 8); Var a10(vm, startIdx + 9); Var a11(vm, startIdx + 10); Var a12(vm, startIdx + 11); Var a13(vm, startIdx + 12); Var a14(vm, startIdx + 13); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, a9.value, a10.value, a11.value, a12.value, a13.value, a14.value ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } }; // // Global Function Resolvers // // Arg Count 0 template SQFUNCTION SqGlobalFunc(R (* /*method*/)()) { return &SqGlobal::template Func0; } // Arg Count 0 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)()) { return &SqGlobal::template Func0; } // Arg Count 1 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 1 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 2 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 2 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 3 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 3 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 4 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 4 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 5 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 5 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 6 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 6 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 7 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 7 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 8 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 8 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 9 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 9 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 10 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 10 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 11 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 11 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 12 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 12 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 13 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 13 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 14 template SQFUNCTION SqGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // Arg Count 14 template SQFUNCTION SqGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // // Member Global Function Resolvers // // Arg Count 1 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 1 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1)) { return &SqGlobal::template Func1; } // Arg Count 2 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 2 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2)) { return &SqGlobal::template Func2; } // Arg Count 3 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 3 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3)) { return &SqGlobal::template Func3; } // Arg Count 4 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 4 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4)) { return &SqGlobal::template Func4; } // Arg Count 5 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 5 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5)) { return &SqGlobal::template Func5; } // Arg Count 6 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 6 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6)) { return &SqGlobal::template Func6; } // Arg Count 7 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 7 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7)) { return &SqGlobal::template Func7; } // Arg Count 8 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 8 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8)) { return &SqGlobal::template Func8; } // Arg Count 9 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 9 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9)) { return &SqGlobal::template Func9; } // Arg Count 10 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 10 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)) { return &SqGlobal::template Func10; } // Arg Count 11 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 11 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11)) { return &SqGlobal::template Func11; } // Arg Count 12 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 12 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12)) { return &SqGlobal::template Func12; } // Arg Count 13 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 13 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13)) { return &SqGlobal::template Func13; } // Arg Count 14 template SQFUNCTION SqMemberGlobalFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // Arg Count 14 template SQFUNCTION SqMemberGlobalFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14)) { return &SqGlobal::template Func14; } // // Squirrel Global Functions // template class SqGlobalFmt { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() StackStrF fmt(vm, 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)(fmt); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 1)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 1, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 2)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 3)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 3, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 4)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 4, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 5)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 5, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 6)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 6, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 7)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 7, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 8)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R (*M)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 8, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVar(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } }; // // reference return specialization // template class SqGlobalFmt { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() StackStrF fmt(vm, 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)(fmt); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 1)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 1, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 2)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 3)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 3, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 4)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 4, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 5)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 5, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 6)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 6, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 7)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 7, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 8)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef R& (*M)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 8, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } R& ret = (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } PushVarR(vm, ret); SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 1; } }; // // void return specialization // template <> class SqGlobalFmt { public: // Arg Count 0 template static SQInteger Func0(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < 2) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() StackStrF fmt(vm, 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)(fmt); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 1 template static SQInteger Func1(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 1)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 1, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 2 template static SQInteger Func2(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 2)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 2, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 3 template static SQInteger Func3(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 3)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 3, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 4 template static SQInteger Func4(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 4)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 4, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, a4.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 5 template static SQInteger Func5(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 5)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 5, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 6 template static SQInteger Func6(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 6)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 6, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 7 template static SQInteger Func7(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 7)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 7, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } // Arg Count 8 template static SQInteger Func8(HSQUIRRELVM vm) { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && sq_gettop(vm) < (startIdx + 8)) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif typedef void (*M)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &); M* method; sq_getuserdata(vm, -1, (SQUserPointer*)&method, NULL); SQTRY() Var a1(vm, startIdx); Var a2(vm, startIdx + 1); Var a3(vm, startIdx + 2); Var a4(vm, startIdx + 3); Var a5(vm, startIdx + 4); Var a6(vm, startIdx + 5); Var a7(vm, startIdx + 6); Var a8(vm, startIdx + 7); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } StackStrF fmt(vm, startIdx + 8, true); // Validate the format if (SQ_FAILED(fmt.mRes)) { return fmt.mRes; } (*method)( a1.value, a2.value, a3.value, a4.value, a5.value, a6.value, a7.value, a8.value, fmt ); SQCATCH_NOEXCEPT(vm) { return sq_throwerror(vm, SQWHAT_NOEXCEPT(vm)); } SQCATCH(vm) { return sq_throwerror(vm, SQWHAT(vm)); } return 0; } }; // // Formatted Global Function Resolvers // // Arg Count 0 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(const StackStrF &)) { return &SqGlobalFmt::template Func0; } // Arg Count 0 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(const StackStrF &)) { return &SqGlobalFmt::template Func0; } // Arg Count 1 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, const StackStrF &)) { return &SqGlobalFmt::template Func1; } // Arg Count 1 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, const StackStrF &)) { return &SqGlobalFmt::template Func1; } // Arg Count 2 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, const StackStrF &)) { return &SqGlobalFmt::template Func2; } // Arg Count 2 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, const StackStrF &)) { return &SqGlobalFmt::template Func2; } // Arg Count 3 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, const StackStrF &)) { return &SqGlobalFmt::template Func3; } // Arg Count 3 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, const StackStrF &)) { return &SqGlobalFmt::template Func3; } // Arg Count 4 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, const StackStrF &)) { return &SqGlobalFmt::template Func4; } // Arg Count 4 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, const StackStrF &)) { return &SqGlobalFmt::template Func4; } // Arg Count 5 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, const StackStrF &)) { return &SqGlobalFmt::template Func5; } // Arg Count 5 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, const StackStrF &)) { return &SqGlobalFmt::template Func5; } // Arg Count 6 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, const StackStrF &)) { return &SqGlobalFmt::template Func6; } // Arg Count 6 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, const StackStrF &)) { return &SqGlobalFmt::template Func6; } // Arg Count 7 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &)) { return &SqGlobalFmt::template Func7; } // Arg Count 7 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &)) { return &SqGlobalFmt::template Func7; } // Arg Count 8 template SQFUNCTION SqGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &)) { return &SqGlobalFmt::template Func8; } // Arg Count 8 template SQFUNCTION SqGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &)) { return &SqGlobalFmt::template Func8; } // // Formatted Member Global Function Resolvers // // Arg Count 1 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, const StackStrF &)) { return &SqGlobalFmt::template Func1; } // Arg Count 1 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, const StackStrF &)) { return &SqGlobalFmt::template Func1; } // Arg Count 2 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, const StackStrF &)) { return &SqGlobalFmt::template Func2; } // Arg Count 2 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, const StackStrF &)) { return &SqGlobalFmt::template Func2; } // Arg Count 3 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, const StackStrF &)) { return &SqGlobalFmt::template Func3; } // Arg Count 3 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, const StackStrF &)) { return &SqGlobalFmt::template Func3; } // Arg Count 4 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, const StackStrF &)) { return &SqGlobalFmt::template Func4; } // Arg Count 4 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, const StackStrF &)) { return &SqGlobalFmt::template Func4; } // Arg Count 5 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, const StackStrF &)) { return &SqGlobalFmt::template Func5; } // Arg Count 5 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, const StackStrF &)) { return &SqGlobalFmt::template Func5; } // Arg Count 6 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, const StackStrF &)) { return &SqGlobalFmt::template Func6; } // Arg Count 6 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, const StackStrF &)) { return &SqGlobalFmt::template Func6; } // Arg Count 7 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &)) { return &SqGlobalFmt::template Func7; } // Arg Count 7 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, const StackStrF &)) { return &SqGlobalFmt::template Func7; } // Arg Count 8 template SQFUNCTION SqMemberGlobalFmtFunc(R (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &)) { return &SqGlobalFmt::template Func8; } // Arg Count 8 template SQFUNCTION SqMemberGlobalFmtFunc(R& (* /*method*/)(A1, A2, A3, A4, A5, A6, A7, A8, const StackStrF &)) { return &SqGlobalFmt::template Func8; } /// @endcond } #endif