mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
FIX: Load Lua modules under Linux
This commit is contained in:
parent
145bd7e584
commit
d162b5dfab
1 changed files with 8 additions and 5 deletions
|
|
@ -1146,11 +1146,14 @@ uses
|
|||
end;
|
||||
|
||||
function LoadLuaLib(filename:string):boolean;
|
||||
begin
|
||||
result:=false;
|
||||
LuaLibD:=LoadLibrary(FileName);
|
||||
result:= (LuaLibD<>0);
|
||||
if LuaLibD=0 then exit;
|
||||
begin
|
||||
{$IF DEFINED(UNIX)}
|
||||
LuaLibD:= TLibHandle(dlopen(PAnsiChar(FileName), RTLD_NOW or RTLD_GLOBAL));
|
||||
{$ELSE}
|
||||
LuaLibD:= LoadLibrary(FileName);
|
||||
{$ENDIF}
|
||||
Result:= (LuaLibD <> NilHandle);
|
||||
if not Result then Exit;
|
||||
|
||||
lua_newstate:=Tlua_newstate(GetProcAddress(LuaLibD,'lua_newstate'));
|
||||
lua_close:=Tlua_close(GetProcAddress(LuaLibD,'lua_close'));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue