[PATCH 14/15] widl: add public attribute to typedefs with generated names when building typelib

Richard Pospesel richard at torproject.org
Fri Jul 5 16:51:43 CDT 2019


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47050
Signed-off-by: Richard Pospesel <richard at torproject.org>
---
 tools/widl/parser.y | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index f7c51c1d64..ef8c040f37 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2058,7 +2058,13 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
       type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION)
   {
     if (!type->name)
+    {
       type->name = gen_name();
+      /* the generated name will be used and this typedef excluded from the
+       * built typelib unless the typedef has the 'public' attribute, so add it here */
+      if (do_typelib && !is_attr(attrs, ATTR_PUBLIC))
+        attrs = append_attr(attrs, make_attr(ATTR_PUBLIC));
+    }
 
     /* replace existing attributes when generating a typelib */
     if (do_typelib)
-- 
2.17.1




More information about the wine-devel mailing list