summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/m_core.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-04-17 15:43:34 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-04-17 15:43:34 +0000
commit55b1f7fafef7085638c4c8604b248bbe9fe08124 (patch)
treecf8fc89ba253985bab9410116d091be1249e81dd /plugins/MirLua/src/m_core.cpp
parent1b3541ce712bc0abd6da9c544afd0d62e32fe930 (diff)
MirLua:
- added function topointer into _G - overrided tonumber to support pointers - api methods is only support light userdata as wparam/lparam git-svn-id: http://svn.miranda-ng.org/main/trunk@16697 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/m_core.cpp')
-rw-r--r--plugins/MirLua/src/m_core.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/MirLua/src/m_core.cpp b/plugins/MirLua/src/m_core.cpp
index 6ec526101e..3b7e841c1e 100644
--- a/plugins/MirLua/src/m_core.cpp
+++ b/plugins/MirLua/src/m_core.cpp
@@ -360,6 +360,15 @@ static int core_TerminateThread(lua_State *L)
return 1;
}
+int core_ptr2number(lua_State *L)
+{
+ ObsoleteMethod(L, "Use tonumber(x) instead");
+
+ luaL_checktype(L, 1, LUA_TLIGHTUSERDATA);
+ lua_pushnumber(L, (intptr_t)lua_touserdata(L, 1));
+ return 1;
+}
+
luaL_Reg coreApi[] =
{
{ "CreateHookableEvent", core_CreateHookableEvent },
@@ -389,7 +398,7 @@ luaL_Reg coreApi[] =
{ "ForkThread", core_ForkThread },
{ "TerminateThread", core_TerminateThread },
- { "PointerToNumber", luaM_ptr2number },
+ { "PointerToNumber", core_ptr2number },
{ "GetFullPath", core_GetFullPath },