Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

I can't seem to set enum values #9

Closed
daurnimator opened this issue Apr 20, 2012 · 1 comment
Closed

I can't seem to set enum values #9

daurnimator opened this issue Apr 20, 2012 · 1 comment

Comments

@daurnimator
Copy link

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>

@jmckaskill
Copy link
Owner

Thanks for the report. I thought I had an enum test in the test suite.... but apparently not.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants