summaryrefslogtreecommitdiff
path: root/rtl/m68k
diff options
context:
space:
mode:
authorpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-12-18 14:04:14 +0000
committerpierre <pierre@3ad0048d-3df7-0310-abae-a5850022a9f2>2012-12-18 14:04:14 +0000
commitb5aa66c3a81a53a5d48982b4f7dfe8e4a8ed15be (patch)
treefafb39455ed4c035d3908aa15f2369f4742e7fa8 /rtl/m68k
parentfcd6570756bb0649d33ffd8ec789d84798e75669 (diff)
downloadfpc-b5aa66c3a81a53a5d48982b4f7dfe8e4a8ed15be.tar.gz
add fpc_longword_to_double if needed
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23173 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/m68k')
-rw-r--r--rtl/m68k/math.inc29
1 files changed, 18 insertions, 11 deletions
diff --git a/rtl/m68k/math.inc b/rtl/m68k/math.inc
index f58486aaf3..bb295ae816 100644
--- a/rtl/m68k/math.inc
+++ b/rtl/m68k/math.inc
@@ -10,17 +10,24 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
-
-{$WARNING FIX ME!! dummy int64_to_double
-function fpc_int64_to_double(i: int64): double; compilerproc;
-assembler;
-asm
-end;
-}
-{$WARNING FIX ME!! dummy longword_to_double
+
+{$ifdef FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}
function fpc_longword_to_double(i: longword): double; compilerproc;
-assembler;
-asm
+var
+ l : longint;
+begin
+{$ifopt R+}
+{$define HAS_OPTR}
+{$endif}
+{$r-}
+ l:=longint(i);
+{$ifdef HAS_OPTR}
+{$r+}
+{$endif}
+ if l>=0 then
+ fpc_longword_to_double:=double(l)
+ else
+ fpc_longword_to_double:=-double(abs(l));
end;
-}
+{$endif FPC_INCLUDE_SOFTWARE_LONGWORD_TO_DOUBLE}