Browse Source

* fpc_int_real fixed for wince.

git-svn-id: trunk@4095 -
yury 19 years ago
parent
commit
47bd76cd2f
1 changed files with 10 additions and 1 deletions
  1. 10 1
      rtl/wince/system.pp

+ 10 - 1
rtl/wince/system.pp

@@ -214,9 +214,18 @@ end;
 {$ifdef CPUARM}
 
 {$define FPC_SYSTEM_HAS_INT}
+function floor(d : double) : double; 
+   cdecl;external 'coredll' name 'floor';
+
+function ceil(d : double) : double; 
+   cdecl;external 'coredll' name 'ceil';
+
 function fpc_int_real(d: ValReal): ValReal;compilerproc;
 begin
-  fpc_int_real := i64tod(trunc(d));
+  if d > 0 then
+    fpc_int_real:=floor(d)
+  else  
+    fpc_int_real:=ceil(d);
 end;
 
 {$define FPC_SYSTEM_HAS_TRUNC}