diff options
author | truebrain <truebrain@openttd.org> | 2011-11-19 15:41:29 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-19 15:41:29 +0000 |
commit | dbd66cf523a1707c6ac2db2d49fda8e5201d91b5 (patch) | |
tree | aea76a26fc5da036f70af40bc94da4249b1283a3 /src/ai/api/ai_date.hpp.sq | |
parent | 6afcc85be45633548626269cd304b7951e51956c (diff) | |
download | openttd-dbd66cf523a1707c6ac2db2d49fda8e5201d91b5.tar.xz |
(svn r23261) -Codechange: Squirrel glue templates were not inline (tnx to michi_cc)
Diffstat (limited to 'src/ai/api/ai_date.hpp.sq')
-rw-r--r-- | src/ai/api/ai_date.hpp.sq | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ai/api/ai_date.hpp.sq b/src/ai/api/ai_date.hpp.sq index 6a5a01222..a37ab5486 100644 --- a/src/ai/api/ai_date.hpp.sq +++ b/src/ai/api/ai_date.hpp.sq @@ -13,11 +13,11 @@ namespace SQConvert { /* Allow AIDate to be used as Squirrel parameter */ - template <> AIDate *GetParam(ForceType<AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } - template <> AIDate &GetParam(ForceType<AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } - template <> const AIDate *GetParam(ForceType<const AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } - template <> const AIDate &GetParam(ForceType<const AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } - template <> int Return<AIDate *>(HSQUIRRELVM vm, AIDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIDate", res, NULL, DefSQDestructorCallback<AIDate>); return 1; } + template <> inline AIDate *GetParam(ForceType<AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } + template <> inline AIDate &GetParam(ForceType<AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } + template <> inline const AIDate *GetParam(ForceType<const AIDate *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIDate *)instance; } + template <> inline const AIDate &GetParam(ForceType<const AIDate &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIDate *)instance; } + template <> inline int Return<AIDate *>(HSQUIRRELVM vm, AIDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIDate", res, NULL, DefSQDestructorCallback<AIDate>); return 1; } } // namespace SQConvert template <> const char *GetClassName<AIDate>() { return "AIDate"; } |