lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Alexander Nasonov wrote:
>  - msgpack_unpack_next C function because LuaJIT doesn't support
>    bool/_Bool in return type. If I change it to int (and "not ok"
>    to "ok == 0"), v.lua from LuaJIT stops complaining about
>    unsupported function. To do it properly you need to wrap
>    msgpack_unpack_next but it'd be nice to hear from Mike about
>    supporting bool in LuaJIT.

I've just pushed some changes to git HEAD. C functions with bool
return values are compiled now.

>    I came accross this before with ffi.errno() function. It would be
>    nice to have support for these functions but I presume it's not a
>    trivial thing. Even for Mike ;-)

ffi.errno() is not compiled, because it's supposed to be called
only in the (uncommon) error path. You need to check the return
value of most standard C functions before you can assume a valid
errno value:

  if ffi.C.foo() == -1 then
    local err = ffi.errno() -- Uncommon error path.
    ...
    error(...)
  end
  -- Continue on fast path.

--Mike