long longlong in libffi

Andreas Tobler toa@pop.agri.ch
Tue Jan 21 06:36:00 GMT 2003


Hi,

I have a bit a problem here, either I don't understand or something is 
wrong.
The box sitting on is a darwin6.3 machine. PPC 7410.

I run into problems when I play with long and longlong.

My system claims long as 4 byte and longlong as 8 bytes.

 From the config.status of libffi.
${ac_dA}SIZEOF_LONG${ac_dB}SIZEOF_LONG${ac_dC}4${ac_dD}
${ac_dA}SIZEOF_LONG_LONG${ac_dB}SIZEOF_LONG_LONG${ac_dC}8${ac_dD}

from fficonfig.h:
/* The number of bytes in a long.  */
#define SIZEOF_LONG 4

/* The number of bytes in a long long.  */
#define SIZEOF_LONG_LONG 8

from ffi.h
if SIZEOF_LONG == 4

#define UINT32  unsigned long
#define SINT32  long
#define ffi_type_ulong ffi_type_uint32
#define ffi_type_slong ffi_type_sint32

[snip]

#if SIZEOF_LONG == 8

#define UINT64  unsigned long
#define SINT64  long
#define ffi_type_ulong ffi_type_uint64
#define ffi_type_slong ffi_type_sint64

#else
#if SIZEOF_LONG_LONG == 8

#define UINT64  unsigned long long
#define SINT64  long long
#define ffi_type_ulong ffi_type_uint64
#define ffi_type_slong ffi_type_sint64


So in mycase the ffi_type_ulong gets uint64 and I can't distinguish 
between long and longlong except with uint32/64


What do I don't see here, is this the correct behavior?

Thanks,

Andreas



More information about the Java mailing list