mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* made HMODULE a PtrInt on unix, this is compatible with the other platforms
git-svn-id: trunk@1104 -
This commit is contained in:
parent
ee9862d231
commit
66e8097281
@ -21,6 +21,9 @@ Function dlopen(Name : PChar; Flags : longint) : Pointer; cdecl; external libdl;
|
||||
FUnction dlsym(Lib : Pointer; Name : Pchar) : Pointer; cdecl; external Libdl;
|
||||
Function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
|
||||
Function dlerror() : Pchar; cdecl; external libdl;
|
||||
{ overloaded for compatibility with hmodule }
|
||||
FUnction dlsym(Lib : PtrInt; Name : Pchar) : Pointer; cdecl; external Libdl;
|
||||
Function dlclose(Lib : PtrInt) : Longint; cdecl; external libdl;
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -20,10 +20,11 @@
|
||||
---------------------------------------------------------------------}
|
||||
|
||||
Type
|
||||
TLibHandle = Pointer;
|
||||
{ using PtrInt here is compliant with the other platforms }
|
||||
TLibHandle = PtrInt;
|
||||
|
||||
Const
|
||||
NilHandle = Nil;
|
||||
NilHandle : TLibHandle = 0;
|
||||
|
||||
{$else}
|
||||
|
||||
@ -36,7 +37,7 @@ uses dl;
|
||||
Function LoadLibrary(Name : AnsiString) : TLibHandle;
|
||||
|
||||
begin
|
||||
Result:=dlopen(Pchar(Name),RTLD_LAZY);
|
||||
Result:=TLibHandle(dlopen(Pchar(Name),RTLD_LAZY));
|
||||
end;
|
||||
|
||||
Function GetProcedureAddress(Lib : TLibHandle; ProcName : AnsiString) : Pointer;
|
||||
|
Loading…
Reference in New Issue
Block a user