I try to understand differences between 32 bits and 64 bits FFI support for
C structures.
I build a class called MyStruct subclass of FFIExternalStructure.
and define a layout for this structure like this one :
MyStruct class>>fieldsDesc
"self rebuildFieldAccessors"
^ #(
int index ;)
and then I generate automatically the field accessors.
If I use a 32 bit VM, the following method is generated to access the index
field :
index
"This method was automatically generated"
^handle signedLongAt: OFFSET_INDEX
and if I use a 64 bits VM, the same method is generated ...
I'm a bit puzzled because, if sizeof(int) = sizeof(long) in a 32 bits VM,
they have different for 64 bits VM (sizeof(int) = 4 and sizeof(long) = 8).
Someone to explain me or this is a bug ?
Thank you.
--
Serge Stinckwich
UMI UMMISCO 209 (SU/IRD/UY1)
"Programs must be written for people to read, and only incidentally for
machines to execute."http://www.doesnotunderstand.org/