Closed daurnimator closed 12 years ago
Setting enums in a struct doesn't seem to work; Same error if you do it in the constructor; or afterwards.
A test case:
ffi = require"ffi" ffi.cdef [[ typedef enum { foo, } an_enum; typedef struct { an_enum x; } a_struct; ]] local new = ffi.typeof ( "a_struct" ) new(ffi.C.foo)
ERROR: lua: unable to convert argument 2 from lua to cdata<struct 2>
Thanks for the report. I thought I had an enum test in the test suite.... but apparently not.
Setting enums in a struct doesn't seem to work; Same error if you do it in the constructor; or afterwards.
A test case:
ERROR: lua: unable to convert argument 2 from lua to cdata<struct 2>