We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33c5961 commit 1860881Copy full SHA for 1860881
Examples/test-suite/lua/lua_lightuserdata_runme.lua
@@ -1,5 +1,5 @@
1
require("import") -- the import fn
2
-require("lua_lightuserdata") -- import lib
+import("lua_lightuserdata") -- import lib
3
4
local t = lua_lightuserdata
5
local d = t.get_lightuserdata()
Examples/test-suite/lua_lightuserdata.i
@@ -2,15 +2,16 @@
%native(get_lightuserdata) int get_lightuserdata(lua_State* L);
%{
+static int foo;
6
int get_lightuserdata(lua_State* L)
7
{
- lua_pushlightuserdata(L, reinterpret_cast<void*>(0x123456));
8
+ lua_pushlightuserdata(L, &foo);
9
return 1;
10
}
11
%}
12
13
%inline %{
14
bool check_lighuserdata(const void* d) {
- return reinterpret_cast<void*>(0x123456) == d;
15
+ return d == &foo;
16
17
0 commit comments