Dans int64_deserialize, faire attention aux contraintes d'alignement (PR#533)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3779 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2001-09-24 12:39:26 +00:00
parent feb316f2af
commit 9894c1ae59
1 changed files with 11 additions and 0 deletions

View File

@ -263,6 +263,10 @@ CAMLexport int64 Int64_val(value v)
return buffer.j;
}
CAMLexport void Store_int64(value v, int64 i)
{
}
#endif
static int int64_compare(value v1, value v2)
@ -286,7 +290,14 @@ static void int64_serialize(value v, unsigned long * wsize_32,
static unsigned long int64_deserialize(void * dst)
{
#ifndef ARCH_ALIGN_INT64
*((int64 *) dst) = deserialize_sint_8();
#else
union { int32 i[2]; int64 j; } buffer;
buffer.j = deserialize_sint_8();
((int32 *) dst)[0] = buffer.i[0];
((int32 *) dst)[1] = buffer.i[1];
#endif
return 8;
}