From 3a7b2c4c645ffecd24df0862b649e79ca5edbfbf Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 16 Jun 2015 20:20:18 +0000 Subject: MirLua: added NULL to core module git-svn-id: http://svn.miranda-ng.org/main/trunk@14219 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_core.cpp | 2 ++ plugins/MirLua/src/mlua.cpp | 2 ++ plugins/MirLua/src/mlua.h | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp index 77dab3299d..e71c20471d 100644 --- a/plugins/MirLua/src/m_core.cpp +++ b/plugins/MirLua/src/m_core.cpp @@ -206,5 +206,7 @@ luaL_Reg CMLua::coreLib[] = { "Translate", lua_Translate }, { "ReplaceVariables", lua_ReplaceVariables }, + { "NULL", NULL }, + { NULL, NULL } }; diff --git a/plugins/MirLua/src/mlua.cpp b/plugins/MirLua/src/mlua.cpp index f7b5208ccb..cf3562bedc 100644 --- a/plugins/MirLua/src/mlua.cpp +++ b/plugins/MirLua/src/mlua.cpp @@ -13,6 +13,8 @@ CMLua::CMLua() : L(NULL) lua_pop(L, 1); luaL_newlib(L, coreLib); + lua_pushlightuserdata(L, NULL); + lua_setfield(L, -2, "NULL"); lua_setglobal(L, "m"); Preload(MLUA_DATABASE, luaopen_m_database); diff --git a/plugins/MirLua/src/mlua.h b/plugins/MirLua/src/mlua.h index d5a2f0c891..cf1eb7c0fa 100644 --- a/plugins/MirLua/src/mlua.h +++ b/plugins/MirLua/src/mlua.h @@ -5,7 +5,7 @@ class CMLua { private: lua_State *L; - static luaL_Reg coreLib[14]; + static luaL_Reg coreLib[15]; void Preload(const char *name, lua_CFunction func); -- cgit v1.2.3