Fix unwrapping of LUA lightuserdata type. Add test case.
This commit is contained in:
parent
b465531141
commit
33c59614fc
4 changed files with 29 additions and 0 deletions
16
Examples/test-suite/lua_lightuserdata.i
Normal file
16
Examples/test-suite/lua_lightuserdata.i
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
%module lua_lightuserdata
|
||||
|
||||
%native(get_lightuserdata) int get_lightuserdata(lua_State* L);
|
||||
%{
|
||||
int get_lightuserdata(lua_State* L)
|
||||
{
|
||||
lua_pushlightuserdata(L, reinterpret_cast<void*>(0x123456));
|
||||
return 1;
|
||||
}
|
||||
%}
|
||||
|
||||
%inline %{
|
||||
bool check_lighuserdata(const void* d) {
|
||||
return reinterpret_cast<void*>(0x123456) == d;
|
||||
}
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue