error: extern structs cannot contain fields of type '@Vector(2, f32)'
// I understand the following:
note: vectors have no guaranteed in-memory representation
// But I didn't seen in the release notes if there was a prefered way to handle these?
On the ObjectiveC side of my codebase, It is defined as vector_float2 in that case.
I have no idea of conversion will be costless on either zig or objc side ?
Technically this was already true in previous versions, it just wasn’t enforced.
You can fix it by using [2]f32 align(8) (assuming that the ObjectiveC side is also aligned to 8 bytes), you may need to coerce it to Vec2f with @as in some of the use cases though.
Extern structs are basically a C struct and because of that its fields must have a guaranteed in memory representation (which @Vector don’t). vector_float2 is defined as:
This type is created using attribute((ext_vector_type(n)), where “n” is the number of elements. Unlike vector_size, ext_vector_type is only allowed on typedef’s. This class enables syntactic extensions, like Vector Components for accessing points (as .xyzw), colors (as .rgba), and textures (modeled after OpenGL Shading Language).
As far as I can tell you should be fine with defining it as stated above, you can read more about them in here.