From: Hans Leidekker hans@codeweavers.com
midlrt includes this attribute when generating metadata. Adding this attribute when an apicontract is defined allows us to move member references from types to attributes where they belong. --- tools/widl/attribute.c | 1 + tools/widl/typetree.c | 1 + tools/widl/widltypes.h | 1 + 3 files changed, 3 insertions(+)
diff --git a/tools/widl/attribute.c b/tools/widl/attribute.c index feb4c2b5db4..0268cde417f 100644 --- a/tools/widl/attribute.c +++ b/tools/widl/attribute.c @@ -145,6 +145,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" }, /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, + /* ATTR_APICONTACT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "apicontract" }, /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" }, /* ATTR_ASYNC */ { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, /* ATTR_ASYNCUUID */ { 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "async_uuid" }, diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index 441b6cdcea1..3bfb2efeea2 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -913,6 +913,7 @@ type_t *type_apicontract_declare(char *name, struct namespace *namespace) type_t *type_apicontract_define(type_t *apicontract, attr_list_t *attrs, const struct location *where) { apicontract->attrs = check_apicontract_attrs(apicontract->name, attrs); + apicontract->attrs = append_attr(apicontract->attrs, attr_int(*where, ATTR_APICONTRACT, 1)); define_type(apicontract, where); return apicontract; } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 6063aa7ef5e..36d7a179b06 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -75,6 +75,7 @@ enum attr_type ATTR_AGGREGATABLE, ATTR_ALLOCATE, ATTR_ANNOTATION, + ATTR_APICONTRACT, /* implicit attribute */ ATTR_APPOBJECT, ATTR_ASYNC, ATTR_ASYNCUUID,