diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-11-09 07:56:54 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-11-09 07:56:54 +0000 |
commit | 7002a39f06ab323970bee8ace4a85fc37c14d882 (patch) | |
tree | 0a9146b081609a686475f8333ef15cecd3e04139 /plugins | |
parent | d0057ced529d2a09f55a900456ea858476120454 (diff) |
MirLua: attempt to fix build on vs2010
git-svn-id: http://svn.miranda-ng.org/main/trunk@15699 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MirLua/src/mlua_metatable.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/MirLua/src/mlua_metatable.h b/plugins/MirLua/src/mlua_metatable.h index ffedc22134..64ccf5a77d 100644 --- a/plugins/MirLua/src/mlua_metatable.h +++ b/plugins/MirLua/src/mlua_metatable.h @@ -45,7 +45,7 @@ private: return res;
}
- static int __new(lua_State *L)
+ static int lua__new(lua_State *L)
{
T *obj = NULL;
T **udata = NULL;
@@ -68,7 +68,7 @@ private: return 1;
}
- static int __index(lua_State *L)
+ static int lua__index(lua_State *L)
{
T *obj = *(T**)luaL_checkudata(L, 1, MT::name);
const char *key = lua_tostring(L, 2);
@@ -111,7 +111,7 @@ private: return 1;
}
- static int __gc(lua_State *L)
+ static int lua__gc(lua_State *L)
{
T** obj = (T**)luaL_checkudata(L, 1, MT::name);
MT::Free(obj);
@@ -120,19 +120,21 @@ private: static T* Load(lua_State *L) { return (T*)lua_touserdata(L, 1); }
static T* Init(T *val) { return val; }
- static void Free(T *obj) { obj = NULL; }
+ static void Free(T **obj) { *obj = NULL; }
public:
MT(lua_State *L, const char *tname)
{
MT::name = tname;
- lua_pushcfunction(L, __new);
+ lua_pushcfunction(L, lua__new);
lua_setglobal(L, MT::name);
luaL_newmetatable(L, MT::name);
- lua_pushcfunction(L, __index);
+ lua_pushcfunction(L, lua__index);
lua_setfield(L, -2, "__index");
+ lua_pushcfunction(L, lua__gc);
+ lua_setfield(L, -2, "__gc");
}
template<typename R>
|