mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 20:26:00 +02:00
+ Fixed objinc such that it really compiles
This commit is contained in:
parent
b0b403d498
commit
4afe7023c2
@ -56,14 +56,20 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
|
|
||||||
FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
|
FUNCTION SetFileSize (Handle: THandle; FileSize: LongInt): Word;
|
||||||
|
|
||||||
|
Var sr : syscallregs;
|
||||||
{$IFDEF DOSSETFILE1}
|
{$IFDEF DOSSETFILE1}
|
||||||
VAR Actual, Buf: LongInt;
|
Actual, Buf: LongInt;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
BEGIN
|
BEGIN
|
||||||
if Sys_Truncate(Handle,FileSize)=0 then
|
sr.reg2:=Handle;
|
||||||
SetFileSize:=0
|
sr.reg3:=FileSize;
|
||||||
|
Syscall(syscall_nr_Truncate,sr);
|
||||||
|
If Errno=0 then
|
||||||
|
SetFileSize:=0
|
||||||
else
|
else
|
||||||
SetFileSize:=103;
|
SetFileSize:=103;
|
||||||
{$IFDEF DOSSETFILE1}
|
{$IFDEF DOSSETFILE1}
|
||||||
If (Actual = FileSize) Then Begin { No position error }
|
If (Actual = FileSize) Then Begin { No position error }
|
||||||
Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual); { Truncate the file }
|
Actual := FileWrite(Handle, Pointer(@Buf), 0,Actual); { Truncate the file }
|
||||||
|
Loading…
Reference in New Issue
Block a user