lua-users home
lua-l archive

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


I think this is a bug in LuaJIT FFI module, probably not very serious
but still annoying for me.
According to the manual, it should be possible to load the system
library zlib on Posix systems like this :

local zlib = ffi.load("z")

This doesn't work on Cygwin, because library file names are different
from Linux.
On this platform, you have to provide the full path name.

Looking at clib_extname in lj_clib.c, we see that ffi.load tries to
open libXXX.dylib on MacOS or libXXX.so on other Posix platforms.
But on Cygwin, the libraries are named cygXXX.dll (and are placed in
/bin directory), like /bin/cygz.dll
So to support that platform, CLIB_SOEXT must me defined to ".dll", and
the test for the "lib" prefix must be adapted to the "cyg" prefix.