lua-users home
lua-l archive

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

> if ffi.exports(ffi.C, 'known_function') then

local pointer, ok_or_error = pcall(function () return ffi.C['known_function'] end )

> - fail, *without* polluting cdef

Yup I can see a problem when two separate libraries define functions under same name, but different prototype. Then calling that with FFI is no go. One you define 1st prototype you cannot redefine it for 2nd library.

Would be nice if cdef took library as optional argument and defined symbols in the library context not global context. 
Adam Strzelecki