This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
re: long longlong in libffi (powerpc)
- From: Andreas Tobler <toa at pop dot agri dot ch>
- To: green at redhat dot com,java at gcc dot gnu dot org
- Date: Tue, 21 Jan 2003 09:22:18 +0100
- Subject: re: long longlong in libffi (powerpc)
To follow up. (Sorry can't quote, webmail)
The problem I have is also visible on powerpc-linux.
Given this testcase:
static void closure_test_fn4(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
*(ffi_arg*)resp =
(int)*(long *)args[0] +(*(int *)args[1]) +
/* (int)(*(float *)args[2]) + *(int *)args[3]*/ + (int)(long)userdata;
printf("%d %d %d %d: %d\n",
(int)*(long *)args[0], (*(int *)args[1]),
/* (int)(*(float *)args[2]), *(int *)args[3],*/ (int)(long)userdata,
*(int*)resp);
}
typedef int (*closure_test_type4)(long, int);
I run it with this definition:
cl_arg_types[0] = &ffi_type_ulong;
cl_arg_types[1] = &ffi_type_uint;
cl_arg_types[2] = NULL;
Here I get a failure since ulong is 'mapped' onto longlong (8bytes)
setting the arg[0] type to &ffi_type_uint32 makes the testcase pass.
So I'm a bit confused. My long is 4 byte, my longlong 8. And the ABI from
sysv & darwin handles the long and the longlong different. (long !=longlong)
Do I follow a phantom or my one explain to me what I forget?
Thank you in advance.
Andreas