From 31483138ec9d30193e5b081b011619a8c9ad10f9 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Sun, 11 Jan 2015 09:40:39 +0100 Subject: [PATCH] luaengine: luabridge Stack specialization Provide a Stack specialization for luabridge, later needed by some APIs. Signed-off-by: Luca Bruno --- src/emu/luaengine.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/emu/luaengine.c b/src/emu/luaengine.c index 1af1c0f0aff..6c37e4e9b58 100644 --- a/src/emu/luaengine.c +++ b/src/emu/luaengine.c @@ -961,3 +961,21 @@ void lua_engine::start() { resume(m_lua_state); } + + +//************************************************************************** +// LuaBridge Stack specializations +//************************************************************************** + +namespace luabridge { + template <> + struct Stack { + static inline void push (lua_State* L, UINT64 value) { + lua_pushunsigned(L, static_cast (value)); + } + + static inline UINT64 get (lua_State* L, int index) { + return static_cast (luaL_checkunsigned (L, index)); + } + }; +}