-
Notifications
You must be signed in to change notification settings - Fork 225
Open
Description
Just testing the windows 64 bit.
-- test_ffi.lua
local ffi = require "ffi"
ffi.cdef [[
typedef struct { float x, y; } Pos;
]]
local p = ffi.new("Pos")
local cp_new = ffi.new("void*", p)
local cp_cast = ffi.cast("void*", p)
print("Type of p:", type(p))
print("Type of cp_new:", type(cp_new))
print("Type of cp_cast:", type(cp_cast))
Type of p: cdata
Type of cp_new: cdata
Type of cp_cast: cdata
I wonder if this is correct?
I wonder how to create lightuserdata lua script to c to check lightuserdata ?
One reason is I having problem what type it is. lua_type it return 10 which outside the LUA_ that I current found.
LUA_TNONE -1
LUA_TNIL 0
LUA_TBOOLEAN 1
LUA_TNUMBER 3
LUA_TSTRING 4
LUA_TTABLE 5
LUA_TFUNCTION 6
LUA_TUSERDATA 7
LUA_TTHREAD 8
Metadata
Metadata
Assignees
Labels
No labels