Update pre-generated bindings code.

pull/15/merge
Robert G. Jakabosky 15 years ago
parent f7f294d942
commit c7e5f0c93f

@ -786,7 +786,18 @@ static const char zmq_ffi_lua_code[] = "local error = error\n"
"local OBJ_TYPE_FLAG_WEAK_REF = 1\n"
"local OBJ_TYPE_SIMPLE = 2\n"
"\n"
"ffi.cdef[[\n"
"local function ffi_safe_cdef(block_name, cdefs)\n"
" local fake_type = \"struct sentinel_\" .. block_name .. \"_ty\"\n"
" local stat, size = pcall(ffi.sizeof, fake_type)\n"
" if stat and size > 0 then\n"
" -- already loaded this cdef block\n"
" return\n"
" end\n"
" cdefs = fake_type .. \"{ int a; int b; int c; };\" .. cdefs\n"
" return ffi.cdef(cdefs)\n"
"end\n"
"\n"
"ffi_safe_cdef(\"LuaNativeObjects\", [[\n"
"\n"
"typedef struct obj_type obj_type;\n"
"\n"
@ -811,7 +822,7 @@ static const char zmq_ffi_lua_code[] = "local error = error\n"
" uint32_t flags; /**< lua_own:1bit */\n"
"} obj_udata;\n"
"\n"
"]]\n"
"]])\n"
"\n"
"-- cache mapping of cdata to userdata\n"
"local weak_objects = setmetatable({}, { __mode = \"v\" })\n"

Loading…
Cancel
Save