summaryrefslogtreecommitdiff
path: root/byterun/ints.c
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2008-04-09 16:32:09 +0000
committerAlain Frisch <alain@frisch.fr>2008-04-09 16:32:09 +0000
commit7332e6d6d3aa8743e167a506581962d105bf7788 (patch)
treeee8827eeca7bb8fcae8207422c42a19160e256e4 /byterun/ints.c
parentcbfeebb112b7a3e396e26606fd3b7cd0a198e79d (diff)
downloadocaml-cducetrunk.tar.gz
Merge from diff ocaml3100/ocaml3102: cvs update -j ocaml3100 -j ocaml3102 -kkcducetrunk
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/cducetrunk@8864 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/ints.c')
-rw-r--r--byterun/ints.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/byterun/ints.c b/byterun/ints.c
index 23ee463296..ed18e6f446 100644
--- a/byterun/ints.c
+++ b/byterun/ints.c
@@ -551,15 +551,21 @@ CAMLprim value caml_int64_of_string(value s)
CAMLprim value caml_int64_bits_of_float(value vd)
{
- union { double d; int64 i; } u;
+ union { double d; int64 i; int32 h[2]; } u;
u.d = Double_val(vd);
+#if defined(__arm__) && !defined(__ARM_EABI__)
+ { int32 t = u.h[0]; u.h[0] = u.h[1]; u.h[1] = t; }
+#endif
return caml_copy_int64(u.i);
}
CAMLprim value caml_int64_float_of_bits(value vi)
{
- union { double d; int64 i; } u;
+ union { double d; int64 i; int32 h[2]; } u;
u.i = Int64_val(vi);
+#if defined(__arm__) && !defined(__ARM_EABI__)
+ { int32 t = u.h[0]; u.h[0] = u.h[1]; u.h[1] = t; }
+#endif
return caml_copy_double(u.d);
}