瀏覽代碼

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