Skip to content

Commit

Permalink
refac last diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Sep 6, 2023
1 parent c45c546 commit e85e138
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python4lazarus/PythonEngine.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3011,12 +3011,9 @@ procedure TDynamicDll.DoOpenDll(const aDllName : String);
{$ifdef windows}
FDLLHandle := Windows.LoadLibrary(PChar(S));
{$else}
//Linux: need here RTLD_GLOBAL, so Python can do "import ctypes"
{$ifdef haiku}
FDLLHandle := PtrInt(dlopen(PAnsiChar(S), RTLD_NOW+RTLD_GLOBAL));
{$else}
FDLLHandle := PtrInt(dlopen(PAnsiChar(S), RTLD_LAZY+RTLD_GLOBAL));
{$endif}
//Linux: need here RTLD_GLOBAL, so Python can do "import ctypes"
//Haiku: without RTLD_NOW it doesn't seem to detect the library or plugins without running with "LD_PRELOAD ..."
FDLLHandle := PtrInt(dlopen(PAnsiChar(S), {$ifdef haiku}RTLD_NOW{$else}RTLD_LAZY{$endif}+RTLD_GLOBAL));
{$endif}
end;
end;
Expand Down

0 comments on commit e85e138

Please sign in to comment.