summaryrefslogtreecommitdiff
path: root/byterun/ints.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2000-03-05 19:17:54 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2000-03-05 19:17:54 +0000
commit96cb7c30af3beeaeab1a7999458740508a964ba3 (patch)
treed3cabd4896a710774060e3ec8167c0a0995d367e /byterun/ints.c
parentfe55dbbdab706f55f4a33f70c880ef1d77555d25 (diff)
downloadocaml-96cb7c30af3beeaeab1a7999458740508a964ba3.tar.gz
Ajout des conversions int <-> int32 <-> int64
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2901 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/ints.c')
-rw-r--r--byterun/ints.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/byterun/ints.c b/byterun/ints.c
index 4a94cc2d05..312d0797dc 100644
--- a/byterun/ints.c
+++ b/byterun/ints.c
@@ -340,6 +340,12 @@ value int64_of_int32(value v) /* ML */
value int64_to_int32(value v) /* ML */
{ return copy_int32((int32) Int64_val(v)); }
+value int64_of_nativeint(value v) /* ML */
+{ return copy_int64(Nativeint_val(v)); }
+
+value int64_to_nativeint(value v) /* ML */
+{ return copy_nativeint((long) Int64_val(v)); }
+
value int64_format(value fmt, value arg) /* ML */
{
char format_string[64], default_format_buffer[64];
@@ -426,6 +432,12 @@ value int64_of_int32(value v)
value int64_to_int32(value v)
{ invalid_argument(int64_error); }
+value int64_of_nativeint(value v)
+{ invalid_argument(int64_error); }
+
+value int64_to_nativeint(value v)
+{ invalid_argument(int64_error); }
+
value int64_format(value fmt, value arg)
{ invalid_argument(int64_error); }
@@ -553,6 +565,12 @@ value nativeint_of_int(value v) /* ML */
value nativeint_to_int(value v) /* ML */
{ return Val_long(Nativeint_val(v)); }
+value nativeint_of_int32(value v) /* ML */
+{ return copy_nativeint(Int32_val(v)); }
+
+value nativeint_to_int32(value v) /* ML */
+{ return copy_int32(Nativeint_val(v)); }
+
value nativeint_format(value fmt, value arg) /* ML */
{
char format_string[32], default_format_buffer[32];