Преглед изворни кода

* check for 64-bit support in FileTruncate based on TOff definition

git-svn-id: trunk@6746 -
Tomas Hajny пре 18 година
родитељ
комит
b06b453ee1
1 измењених фајлова са 4 додато и 5 уклоњено
  1. 4 5
      rtl/unix/sysutils.pp

+ 4 - 5
rtl/unix/sysutils.pp

@@ -241,12 +241,11 @@ end;
 Function FileTruncate (Handle: THandle; Size: Int64) : boolean;
 
 begin
-{$if defined(linux) and defined(fs32bit)}
-  if Size > high (longint) then
-   FileTruncate := false
+  if (SizeOf (TOff) < 8)   (* fpFTruncate only supporting signed 32-bit size *)
+                         and (Size > high (longint)) then
+    FileTruncate := false
   else
-{$endif}
-   FileTruncate:=fpftruncate(Handle,Size)>=0;
+    FileTruncate:=fpftruncate(Handle,Size)>=0;
 end;
 
 Function UnixToWinAge(UnixAge : time_t): Longint;