Vala generates invalid C code with SimpleType structures defined as arrays
Submitted by smx..@..il.com
Link to original bug (#787091)
Description
Created attachment 358866 proposed patch
If the struct being moved is an array, and was declared as [SimpleType], the generated code will fail to compile with
error: assignment to expression with array type
This happens because the left part of the assignment is an array, and as such it's not directly modifiable.
The first idea was to use a custom copy_function, but Vala ignores it in these cases.
The attached patch adds handling for a copy_function with this prototype, if provided by the user:
void foo_copy(foo source, foo dest);
thanks to Rico Tzschichholz for wrapping up a unit test
Patch 358866, "proposed patch":
structs_copy_function.patch