Author: ekohl
Date: Tue Apr 5 21:37:54 2011
New Revision: 51262
URL:
http://svn.reactos.org/svn/reactos?rev=51262&view=rev
Log:
[WIDL]
Reapply the switchtype patch.
Modified:
trunk/reactos/tools/widl/parser.tab.c
trunk/reactos/tools/widl/parser.y
Modified: trunk/reactos/tools/widl/parser.tab.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.tab.c?re…
==============================================================================
--- trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/parser.tab.c [iso-8859-1] Tue Apr 5 21:37:54 2011
@@ -6334,6 +6334,12 @@
else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
+ /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already
have it. */
+ 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 )
{
Modified: trunk/reactos/tools/widl/parser.y
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/parser.y?rev=51…
==============================================================================
--- trunk/reactos/tools/widl/parser.y [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/parser.y [iso-8859-1] Tue Apr 5 21:37:54 2011
@@ -1854,6 +1854,12 @@
else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
+ /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already
have it. */
+ 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 )
{