I have problems passing D struct that contains static array to C.
D code:
extern (C){
struct vec3f{
float[3] array;
}
void testVec3f(vec3f v);
}
...
void test(){
float[3] ar = [1f,2f,3f];
vec3f v = vec3f(ar);
testVec3f(v);
}
C code:
extern "C" struct vec3f{
float array[3];
};
extern "C" void testVec3f(vec3f a){
printf("x=%f, y=%f, z=%f\n", a.array[0], a.array[1], a.array[2]);
}
Result: x=0.000000, y=0.000000, z=0.000000. I also checked that both structs in D and C have the same size - 12 bytes.