On 2015-02-02 at 13:16, irtcupc wrote:
The manual section about interfacing from c states that "type[]" is
inter-compatible from C to D,
however, I face this strange case:
- C declaration:
char identifier[64];
- D declaration:
char[64] identifier;
- the result is only correct if i slice by (- pointer size):
char[64] fromC(char[64] * thing)
{
const offs = size_t.sizeof;
return thing[-offs.sizeof .. $-offs];
}
Is this correct ?
So you have to shift the whole array right by 4 or 8 bytes? Strange.
Looks like an alignment issue. Is identifier part of a bigger structure?