Re: FFI enums are now always boxed

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 18 Jul 2012 20:32:26 +1000

I'm not sure if this is related, but the tostring doesn't print the
enum value...

local ffi = require "ffi"
ffi.cdef[[
typedef enum
{
  foo,
  bar
} MyType;
]]

print(ffi.new("MyType",ffi.C.bar)) -- cdata<enum 95>: 1

Is there any way it could show "cdata<enum 95>: bar"?
(or even "cdata<MyType>: bar")

Other related posts: