+2008-05-12 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valaccodegenerator.vala: add basic support for
+ instance_pos attribute to struct creation methods, fixes bug 530774
+
2008-05-11 Jürg Billeter <j@bitron.ch>
* gobject/valaccodetypesymbolbinding.vala: fix double properties
creation_call = new CCodeFunctionCall (new CCodeIdentifier (m.get_cname ()));
- if (expr.type_reference.data_type is Struct) {
+ if (expr.type_reference.data_type is Struct && !(m.cinstance_parameter_position < 0)) {
creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
} else if (expr.type_reference.data_type is Class) {
var cl = (Class) expr.type_reference.data_type;
i++;
}
+ if (expr.type_reference.data_type is Struct && m.cinstance_parameter_position < 0) {
+ // instance parameter is at the end in a struct creation method
+ creation_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, instance));
+ }
+
if (expr.can_fail) {
// method can fail
current_method_inner_error = true;