From c45c54675cb33e1cad67b61312eb80f4c214acef Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 6 Sep 2023 12:43:43 +0300 Subject: [PATCH] revert DoOpenDll for Linux, change only for Haiku --- python4lazarus/PythonEngine.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python4lazarus/PythonEngine.pas b/python4lazarus/PythonEngine.pas index 58650f5..06fe847 100644 --- a/python4lazarus/PythonEngine.pas +++ b/python4lazarus/PythonEngine.pas @@ -3011,8 +3011,12 @@ 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" - FDLLHandle := PtrInt(dlopen(PAnsiChar(S), RTLD_NOW+RTLD_GLOBAL)); + //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} {$endif} end; end;