From: Hans Leidekker hans@codeweavers.com
This makes the runtimeclass available when metadata for the constructor interface is generated. --- tools/widl/typetree.c | 17 +++++++++++++++++ tools/widl/widltypes.h | 1 + 2 files changed, 18 insertions(+)
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index af62c2a03ba..ab671e021f0 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -748,6 +748,7 @@ type_t *type_interface_define(type_t *iface, attr_list_t *attrs, type_t *inherit iface->details.iface->inherit = inherit; iface->details.iface->disp_inherit = NULL; iface->details.iface->async_iface = NULL; + iface->details.iface->runtime_class = NULL; iface->details.iface->requires = requires; define_type(iface, where); compute_method_indexes(iface); @@ -845,6 +846,21 @@ type_t *type_runtimeclass_declare(char *name, struct namespace *namespace) return type; }
+static void set_constructor_runtimeclass(type_t *runtimeclass, attr_list_t *attrs) +{ + const attr_t *attr; + if (!attrs) return; + LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) + { + if (attr->type == ATTR_ACTIVATABLE || attr->type == ATTR_COMPOSABLE) + { + const expr_t *value = attr->u.pval; + if (value->u.tref.type->details.iface) + value->u.tref.type->details.iface->runtime_class = runtimeclass; + } + } +} + type_t *type_runtimeclass_define(type_t *runtimeclass, attr_list_t *attrs, typeref_list_t *ifaces, const struct location *where) { @@ -853,6 +869,7 @@ type_t *type_runtimeclass_define(type_t *runtimeclass, attr_list_t *attrs,
runtimeclass->attrs = check_runtimeclass_attrs(runtimeclass->name, attrs); runtimeclass->details.runtimeclass.ifaces = ifaces; + set_constructor_runtimeclass(runtimeclass, attrs); define_type(runtimeclass, where);
if (ifaces) LIST_FOR_EACH_ENTRY(ref, ifaces, typeref_t, entry) diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 620a3857bc9..1b032a17c4a 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -403,6 +403,7 @@ struct iface_details struct _type_t *inherit; struct _type_t *disp_inherit; struct _type_t *async_iface; + struct _type_t *runtime_class; typeref_list_t *requires; };