mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 00:47:16 +01:00
* adds version hack check :)
git-svn-id: trunk@7894 -
This commit is contained in:
parent
6491a6e914
commit
6e14df2fc2
@ -75,13 +75,15 @@ var
|
|||||||
DLLSSLName2: string = 'libssl32.dll';
|
DLLSSLName2: string = 'libssl32.dll';
|
||||||
DLLUtilName: string = 'libeay32.dll';
|
DLLUtilName: string = 'libeay32.dll';
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF DARWIN}
|
DLLSSLName: string = 'libssl';
|
||||||
DLLSSLName: string = 'libssl.dylib';
|
DLLUtilName: string = 'libcrypto';
|
||||||
DLLUtilName: string = 'libcrypto.dylib';
|
|
||||||
{$ELSE}
|
{ ADD NEW ONES WHEN THEY APPEAR!
|
||||||
DLLSSLName: string = 'libssl.so';
|
Always make .so/dylib first, then versions, in descending order!
|
||||||
DLLUtilName: string = 'libcrypto.so';
|
Add "." .before the version, first is always just "" }
|
||||||
{$ENDIF}
|
DLLVersions: array[1..10] of string = ('', '.0.9.9'{futureproof :D}, '.0.9.8',
|
||||||
|
'.0.9.7', '.0.9.6', '.0.9.5', '.0.9.4',
|
||||||
|
'.0.9.3', '.0.9.2', '.0.9.1');
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -1151,9 +1153,34 @@ begin
|
|||||||
_DESecbencrypt(Input, output, ks, enc);
|
_DESecbencrypt(Input, output, ks, enc);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IFNDEF WINDOWS}
|
||||||
|
{ Try to load all library versions until you find or run out }
|
||||||
|
function LoadLibHack(const Value: String): HModule;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
Result := NilHandle;
|
||||||
|
|
||||||
|
for i := Low(DLLVersions) to High(DLLVersions) do begin
|
||||||
|
{$IFDEF DARWIN}
|
||||||
|
Result := LoadLibrary(Value + DLLVersions[i] + '.dylib');
|
||||||
|
{$ELSE}
|
||||||
|
Result := LoadLibrary(Value + '.so' + DLLVersions[i]);
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
|
if Result <> NilHandle then
|
||||||
|
Break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
function LoadLib(const Value: String): HModule;
|
function LoadLib(const Value: String): HModule;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF WINDOWS}
|
||||||
Result := LoadLibrary(Value);
|
Result := LoadLibrary(Value);
|
||||||
|
{$ELSE}
|
||||||
|
Result := LoadLibHack(Value);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetProcAddr(module: HModule; const ProcName: string): SslPtr;
|
function GetProcAddr(module: HModule; const ProcName: string): SslPtr;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user