Procházet zdrojové kódy

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

git-svn-id: trunk@1104 -
florian před 20 roky
rodič
revize
66e8097281
2 změnil soubory, kde provedl 7 přidání a 3 odebrání
  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 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
 

+ 4 - 3
rtl/unix/dynlibs.inc

@@ -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;