Ver Fonte

* GetFileHandle(), THandleStream: changed type that is used to store file handle from Integer to THandle, so it can be redefined to 64 bits on certain platforms, see http://lists.freepascal.org/lists/fpc-devel/2010-November/023019.html

git-svn-id: trunk@16383 -
sergei há 14 anos atrás
pai
commit
907e7a32d5

+ 3 - 3
rtl/objpas/classes/classesh.inc

@@ -842,16 +842,16 @@ type
 
   THandleStream = class(TStream)
   private
-    FHandle: Integer;
+    FHandle: THandle;
   protected
     procedure SetSize(NewSize: Longint); override;
     procedure SetSize(const NewSize: Int64); override;
   public
-    constructor Create(AHandle: Integer);
+    constructor Create(AHandle: THandle);
     function Read(var Buffer; Count: Longint): Longint; override;
     function Write(const Buffer; Count: Longint): Longint; override;
     function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;
-    property Handle: Integer read FHandle;
+    property Handle: THandle read FHandle;
   end;
 
 { TFileStream class }

+ 1 - 1
rtl/objpas/classes/streams.inc

@@ -409,7 +409,7 @@ end;
 {*                             THandleStream                                *}
 {****************************************************************************}
 
-Constructor THandleStream.Create(AHandle: Integer);
+Constructor THandleStream.Create(AHandle: THandle);
 
 begin
   FHandle:=AHandle;

+ 2 - 2
rtl/objpas/sysutils/filutilh.inc

@@ -99,6 +99,6 @@ Function FileSearch (Const Name, DirList : String; ImplicitCurrentDir : Boolean
 Function ExeSearch  (Const Name, DirList : String) : String;
 Function FileIsReadOnly(const FileName: String): Boolean;
 
-Function GetFileHandle(var f : File):Longint;
-Function GetFileHandle(var f : Text):Longint;
+Function GetFileHandle(var f : File):THandle;
+Function GetFileHandle(var f : Text):THandle;
 

+ 2 - 2
rtl/objpas/sysutils/fina.inc

@@ -317,13 +317,13 @@ begin
     Result := '';
 end;
 
-Function GetFileHandle(var f : File):Longint;
+Function GetFileHandle(var f : File):THandle;
 
 begin
   result:=filerec(f).handle;
 end;
 
-Function GetFileHandle(var f : Text):Longint;
+Function GetFileHandle(var f : Text):THandle;
 begin
   result:=textrec(f).handle;
 end;