* 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 -
This commit is contained in:
sergei 2010-11-20 12:58:53 +00:00
parent eb698a6d9a
commit 907e7a32d5
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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