I know it’s possible to pass Zig structs to C/C++ functions using extern, however I don’t know how to do the same with file containers. For example, let’s say I have ‘a.zig’:
pub const A = @This();
field1: bool,
field2: int,
//...
And then I have some C function:
void use_A(A value) {
//...
}
What’s the syntax for declaring A as extern so that it matches the C ABI?
export makes a declaration available for linking.
However that wont work as there is no way to mark a file struct as extern meaning it wont follow the C ABI so it cant be exported.