Pass the switchtype attribute from an alias to the base type.

Eric Kohl eric.kohl at t-online.de
Mon Mar 7 11:09:40 CST 2011


---
 tools/widl/parser.y |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 3850e65..91404fb 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1857,6 +1857,12 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
   else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
     attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
 
+  /* Pass the switchtype attribute from an alias to the base type.  */
+  if (type_get_type_detect_alias(type) == TYPE_UNION &&
+      is_attr(attrs, ATTR_SWITCHTYPE) &&
+      !is_attr(type->attrs, ATTR_SWITCHTYPE))
+    type->attrs = append_attr(type->attrs, make_attrp(ATTR_SWITCHTYPE, get_attrp(attrs, ATTR_SWITCHTYPE)));
+
   LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry )
   {
 
-- 
1.7.3.4


--------------080300000708060207030501--



More information about the wine-patches mailing list