From 6f99f13cf590c323fd5bd5b4d6855e59f582fb0e Mon Sep 17 00:00:00 2001 From: aunsane Date: Tue, 12 Sep 2017 22:02:30 +0300 Subject: MirLua: massive refactoring - m_msg_buttonbar moved to m_srrm - version bump --- plugins/MirLua/include/mirlua.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/MirLua/include/mirlua.h (limited to 'plugins/MirLua/include') diff --git a/plugins/MirLua/include/mirlua.h b/plugins/MirLua/include/mirlua.h new file mode 100644 index 0000000000..eee10289bb --- /dev/null +++ b/plugins/MirLua/include/mirlua.h @@ -0,0 +1,23 @@ +#ifndef _MIRLUA_H_ +#define _MIRLUA_H_ + +#include + +__forceinline UINT_PTR luaM_tomparam(lua_State *L, int idx) +{ + switch (lua_type(L, idx)) + { + case LUA_TBOOLEAN: + return lua_toboolean(L, idx); + case LUA_TSTRING: + return (UINT_PTR)lua_tostring(L, idx); + case LUA_TLIGHTUSERDATA: + return (UINT_PTR)lua_touserdata(L, idx); + case LUA_TNUMBER: + if (lua_isinteger(L, idx)) + return (UINT_PTR)lua_tointeger(L, idx); + } + return NULL; +} + +#endif //_MIRLUA_H_ \ No newline at end of file -- cgit v1.2.3