As far as I can tell, cdef only lets you define functions or types. Meaning that code like the following does not work(Does work fine in LuaJIT however)
ffi.cdef[[
// http://clang.llvm.org/docs/Block-ABI-Apple.txt
struct __block_descriptor_1 {
unsigned long int reserved; // NULL
unsigned long int size; // sizeof(struct __block_literal_1)
};
struct __block_literal_1 {
struct __block_literal_1 *isa;
int flags;
int reserved;
void *invoke;
struct __block_descriptor_1 *descriptor;
};
const struct __block_literal_1 *_NSConcreteGlobalBlock; // <-- problem line
]]
As far as I can tell, cdef only lets you define functions or types. Meaning that code like the following does not work(Does work fine in LuaJIT however)
Fails with: unexpected type in root on line 15