diff --git a/girnode.h b/girnode.h index 971df6b9c..9829a9333 100644 --- a/girnode.h +++ b/girnode.h @@ -228,6 +228,9 @@ struct _GIrNodeInterface GList *interfaces; GList *prerequisites; + gint alignment; + gint size; + GList *members; }; diff --git a/giroffsets.c b/giroffsets.c index 66d18555c..1844dd1b5 100644 --- a/giroffsets.c +++ b/giroffsets.c @@ -150,6 +150,14 @@ get_interface_size_alignment (GIrNodeField *field, *alignment = struct_->alignment; break; } + case G_IR_NODE_OBJECT: + case G_IR_NODE_INTERFACE: + { + GIrNodeInterface *interface = (GIrNodeInterface *)iface; + *size = interface->size; + *alignment = interface->alignment; + break; + } case G_IR_NODE_UNION: { GIrNodeUnion *union_ = (GIrNodeUnion *)iface; @@ -426,6 +434,19 @@ g_ir_node_compute_offsets (GIrNode *node, &struct_->size, &struct_->alignment); break; } + case G_IR_NODE_OBJECT: + case G_IR_NODE_INTERFACE: + { + GIrNodeInterface *iface = (GIrNodeInterface *)node; + + if (!check_needs_computation (node, module, iface->alignment)) + return; + + compute_struct_field_offsets (node, iface->members, + module, modules, + &iface->size, &iface->alignment); + break; + } case G_IR_NODE_UNION: { GIrNodeUnion *union_ = (GIrNodeUnion *)node;