[4/6] widl: Attributes of the alias are supposed to replace attributes of a tag in the typelib.

Huw Davies huw at codeweavers.com
Mon Oct 26 06:06:54 CDT 2015

On Thu, Oct 15, 2015 at 08:47:04PM +0800, Dmitry Timoshkov wrote:
> diff --git a/tools/widl/parser.y b/tools/widl/parser.y
> index db5897e..1bd9565 100644
> --- a/tools/widl/parser.y
> +++ b/tools/widl/parser.y
> @@ -1893,6 +1893,10 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
>    {
>      if (!type->name)
>        type->name = gen_name();
> +
> +    /* replace exisitng attributes when generating a typelib */
> +    if (do_typelib)
> +        type->attrs = attrs;
>    }
>    LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry )

I think this is actually correct (typedefs in typelibs are just strange).
However, it would be more convincing if you could add version and helpcontext
attributes to the typedefs and show that the base type gets those too.

Something like:

struct _n { int n1; };
typedef struct _n n;
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753903),version(1), helpcontext(1)]
typedef struct _n nn;

struct _n gets both version and helpcontext from nn (which is interesting
as you can't set version or helpcontext attributes on a structure).

and also:

struct _m { int m1; };
[uuid(016fe2ec-b2c8-45f8-b23b-39e53a753905),hidden, version(2)]
typedef struct _m m;
typedef struct _m mm;

To show that _m doesn't get a version.  i.e. it doesn't get the
union of attributes from m and mm, it just gets the attributes
from the last typedef to reference it.


More information about the wine-devel mailing list