summaryrefslogtreecommitdiff
path: root/Examples/test-suite/lua_lightuserdata.i
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/lua_lightuserdata.i')
-rw-r--r--Examples/test-suite/lua_lightuserdata.i16
1 files changed, 16 insertions, 0 deletions
diff --git a/Examples/test-suite/lua_lightuserdata.i b/Examples/test-suite/lua_lightuserdata.i
new file mode 100644
index 000000000..08e15c93c
--- /dev/null
+++ b/Examples/test-suite/lua_lightuserdata.i
@@ -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;
+}
+%}