Browse Source

* made HMODULE a PtrInt on unix, this is compatible with the other platforms

git-svn-id: trunk@1104 -
florian 20 years ago
parent
commit
66e8097281
2 changed files with 7 additions and 3 deletions
  1. 3 0
      rtl/unix/dl.pp
  2. 4 3
      rtl/unix/dynlibs.inc

+ 3 - 0
rtl/unix/dl.pp

@@ -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 dlsym(Lib : Pointer; Name : Pchar) : Pointer; cdecl; external Libdl;
 Function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
 Function dlclose(Lib : Pointer) : Longint; cdecl; external libdl;
 Function dlerror() : Pchar; 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
 implementation
 
 

+ 4 - 3
rtl/unix/dynlibs.inc

@@ -20,10 +20,11 @@
   ---------------------------------------------------------------------}
   ---------------------------------------------------------------------}
 
 
 Type
 Type
-  TLibHandle = Pointer;
+  { using PtrInt here is compliant with the other platforms }
+  TLibHandle = PtrInt;
 
 
 Const
 Const
-  NilHandle = Nil;
+  NilHandle : TLibHandle = 0;
 
 
 {$else}
 {$else}
 
 
@@ -36,7 +37,7 @@ uses dl;
 Function LoadLibrary(Name : AnsiString) : TLibHandle;
 Function LoadLibrary(Name : AnsiString) : TLibHandle;
 
 
 begin
 begin
-  Result:=dlopen(Pchar(Name),RTLD_LAZY);
+  Result:=TLibHandle(dlopen(Pchar(Name),RTLD_LAZY));
 end;
 end;
 
 
 Function GetProcedureAddress(Lib : TLibHandle; ProcName : AnsiString) : Pointer;
 Function GetProcedureAddress(Lib : TLibHandle; ProcName : AnsiString) : Pointer;