From c2a75cb1799a31aa5687e576d1c0bdd50825fded Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 6 Nov 2016 10:05:36 +0100 Subject: Updated sol2, made lua console not crash for nil data (nw) --- 3rdparty/sol2/sol/stack_push.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to '3rdparty/sol2/sol/stack_push.hpp') diff --git a/3rdparty/sol2/sol/stack_push.hpp b/3rdparty/sol2/sol/stack_push.hpp index 27d28fc081e..cf39d1e40c8 100644 --- a/3rdparty/sol2/sol/stack_push.hpp +++ b/3rdparty/sol2/sol/stack_push.hpp @@ -62,7 +62,7 @@ namespace sol { template static int push(lua_State* L, Args&&... args) { - return push_keyed(L, usertype_traits::metatable, std::forward(args)...); + return push_keyed(L, usertype_traits::metatable(), std::forward(args)...); } }; @@ -87,7 +87,7 @@ namespace sol { } static int push(lua_State* L, T* obj) { - return push_keyed(L, usertype_traits*>::metatable, obj); + return push_keyed(L, usertype_traits*>::metatable(), obj); } }; @@ -140,7 +140,7 @@ namespace sol { *fx = detail::special_destruct; detail::default_construct::construct(mem, std::forward(args)...); *pref = unique_usertype_traits::get(*mem); - if (luaL_newmetatable(L, &usertype_traits>::metatable[0]) == 1) { + if (luaL_newmetatable(L, &usertype_traits>::metatable()[0]) == 1) { set_field(L, "__gc", detail::unique_destruct

); } lua_setmetatable(L, -2); @@ -362,13 +362,13 @@ namespace sol { template , no_metatable_t, metatable_key_t>> = meta::enabler> static int push(lua_State* L, Arg&& arg, Args&&... args) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, std::forward(arg), std::forward(args)...); } template static int push(lua_State* L, no_metatable_t, Args&&... args) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, std::forward(args)...); } @@ -379,22 +379,22 @@ namespace sol { } static int push(lua_State* L, const user& u) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, u.value); } static int push(lua_State* L, user&& u) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, std::move(u.value)); } static int push(lua_State* L, no_metatable_t, const user& u) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, u.value); } static int push(lua_State* L, no_metatable_t, user&& u) { - const auto name = &usertype_traits>::user_gc_metatable[0]; + const auto name = &usertype_traits>::user_gc_metatable()[0]; return push_with(L, name, std::move(u.value)); } }; -- cgit v1.2.3-70-g09d2