mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
allow pointers to be used with property defines
This commit is contained in:
parent
b447c3d69c
commit
0b4548bed3
|
@ -20,8 +20,8 @@
|
|||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// This file was generated with a script.
|
||||
// Generated 2018-03-19 04:19:45.625468 UTC
|
||||
// This header was generated with sol v2.19.5 (revision f50d8e2)
|
||||
// Generated 2018-03-21 21:52:05.424739 UTC
|
||||
// This header was generated with sol v2.19.5 (revision b447c3d)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||
|
@ -12985,6 +12985,7 @@ namespace sol {
|
|||
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 T Ta;
|
||||
typedef std::remove_pointer_t<object_type> Oa;
|
||||
#ifdef SOL_SAFE_USERTYPE
|
||||
auto maybeo = stack::check_get<Ta*>(L, 1);
|
||||
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)");
|
||||
}
|
||||
object_type* o = static_cast<object_type*>(maybeo.value());
|
||||
Oa* o = static_cast<Oa*>(maybeo.value());
|
||||
#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
|
||||
typedef typename wrap::returns_list returns_list;
|
||||
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>
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// This file was generated with a script.
|
||||
// Generated 2018-03-19 04:19:45.849597 UTC
|
||||
// This header was generated with sol v2.19.5 (revision f50d8e2)
|
||||
// Generated 2018-03-21 21:52:05.735306 UTC
|
||||
// This header was generated with sol v2.19.5 (revision b447c3d)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
|
|
|
@ -641,6 +641,7 @@ namespace sol {
|
|||
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 T Ta;
|
||||
typedef std::remove_pointer_t<object_type> Oa;
|
||||
#ifdef SOL_SAFE_USERTYPE
|
||||
auto maybeo = stack::check_get<Ta*>(L, 1);
|
||||
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)");
|
||||
}
|
||||
object_type* o = static_cast<object_type*>(maybeo.value());
|
||||
Oa* o = static_cast<Oa*>(maybeo.value());
|
||||
#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
|
||||
typedef typename wrap::returns_list returns_list;
|
||||
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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user