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

Richard Pospesel richard at torproject.org
Wed Jun 5 20:34:15 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 ff3c0de3f5..66b870b4bb 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2065,7 +2065,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