allow pointers to be used with property defines

This commit is contained in:
ThePhD 2018-03-21 17:52:28 -04:00
parent b447c3d69c
commit 0b4548bed3
3 changed files with 12 additions and 10 deletions

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script. // This file was generated with a script.
// Generated 2018-03-19 04:19:45.625468 UTC // Generated 2018-03-21 21:52:05.424739 UTC
// This header was generated with sol v2.19.5 (revision f50d8e2) // This header was generated with sol v2.19.5 (revision b447c3d)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -12985,6 +12985,7 @@ namespace sol {
static int self_call(std::false_type, lua_State* L, F&& f) { static int self_call(std::false_type, lua_State* L, F&& f) {
typedef meta::pop_front_type_t<typename traits_type::free_args_list> args_list; typedef meta::pop_front_type_t<typename traits_type::free_args_list> args_list;
typedef T Ta; typedef T Ta;
typedef std::remove_pointer_t<object_type> Oa;
#ifdef SOL_SAFE_USERTYPE #ifdef SOL_SAFE_USERTYPE
auto maybeo = stack::check_get<Ta*>(L, 1); auto maybeo = stack::check_get<Ta*>(L, 1);
if (!maybeo || maybeo.value() == nullptr) { if (!maybeo || maybeo.value() == nullptr) {
@ -12993,13 +12994,13 @@ namespace sol {
} }
return luaL_error(L, "sol: 'self' argument is lua_nil (pass 'self' as first argument)"); return luaL_error(L, "sol: 'self' argument is lua_nil (pass 'self' as first argument)");
} }
object_type* o = static_cast<object_type*>(maybeo.value()); Oa* o = static_cast<Oa*>(maybeo.value());
#else #else
object_type* o = static_cast<object_type*>(stack::get<non_null<Ta*>>(L, 1)); Oa* o = static_cast<object_type*>(stack::get<non_null<Ta*>>(L, 1));
#endif // Safety #endif // Safety
typedef typename wrap::returns_list returns_list; typedef typename wrap::returns_list returns_list;
typedef typename wrap::caller caller; typedef typename wrap::caller caller;
return stack::call_into_lua<checked, clean_stack>(returns_list(), args_list(), L, boost + (is_variable ? 3 : 2), caller(), f, *o); return stack::call_into_lua<checked, clean_stack>(returns_list(), args_list(), L, boost + (is_variable ? 3 : 2), caller(), f, detail::implicit_wrapper<Oa>(*o));
} }
template <typename F, typename... Args> template <typename F, typename... Args>

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script. // This file was generated with a script.
// Generated 2018-03-19 04:19:45.849597 UTC // Generated 2018-03-21 21:52:05.735306 UTC
// This header was generated with sol v2.19.5 (revision f50d8e2) // This header was generated with sol v2.19.5 (revision b447c3d)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP

View File

@ -641,6 +641,7 @@ namespace sol {
static int self_call(std::false_type, lua_State* L, F&& f) { static int self_call(std::false_type, lua_State* L, F&& f) {
typedef meta::pop_front_type_t<typename traits_type::free_args_list> args_list; typedef meta::pop_front_type_t<typename traits_type::free_args_list> args_list;
typedef T Ta; typedef T Ta;
typedef std::remove_pointer_t<object_type> Oa;
#ifdef SOL_SAFE_USERTYPE #ifdef SOL_SAFE_USERTYPE
auto maybeo = stack::check_get<Ta*>(L, 1); auto maybeo = stack::check_get<Ta*>(L, 1);
if (!maybeo || maybeo.value() == nullptr) { if (!maybeo || maybeo.value() == nullptr) {
@ -649,13 +650,13 @@ namespace sol {
} }
return luaL_error(L, "sol: 'self' argument is lua_nil (pass 'self' as first argument)"); return luaL_error(L, "sol: 'self' argument is lua_nil (pass 'self' as first argument)");
} }
object_type* o = static_cast<object_type*>(maybeo.value()); Oa* o = static_cast<Oa*>(maybeo.value());
#else #else
object_type* o = static_cast<object_type*>(stack::get<non_null<Ta*>>(L, 1)); Oa* o = static_cast<object_type*>(stack::get<non_null<Ta*>>(L, 1));
#endif // Safety #endif // Safety
typedef typename wrap::returns_list returns_list; typedef typename wrap::returns_list returns_list;
typedef typename wrap::caller caller; typedef typename wrap::caller caller;
return stack::call_into_lua<checked, clean_stack>(returns_list(), args_list(), L, boost + (is_variable ? 3 : 2), caller(), f, *o); return stack::call_into_lua<checked, clean_stack>(returns_list(), args_list(), L, boost + (is_variable ? 3 : 2), caller(), f, detail::implicit_wrapper<Oa>(*o));
} }
template <typename F, typename... Args> template <typename F, typename... Args>