Commit 0aa6049c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

widl: Create exactly one type_t object per named enum type.

Based on a patch by Richard Pospesel. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47035Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 833639bd
......@@ -265,25 +265,27 @@ type_t *type_new_void(void)
type_t *type_new_enum(const char *name, struct namespace *namespace, int defined, var_list_t *enums)
{
type_t *tag_type = name ? find_type(name, namespace, tsENUM) : NULL;
type_t *t = make_type(TYPE_ENUM);
t->name = name;
t->namespace = namespace;
if (tag_type && tag_type->details.enumeration)
t->details.enumeration = tag_type->details.enumeration;
else if (defined)
type_t *t = NULL;
if (name)
t = find_type(name, namespace,tsENUM);
if (!t)
{
t = make_type(TYPE_ENUM);
t->name = name;
t->namespace = namespace;
if (name)
reg_type(t, name, namespace, tsENUM);
}
if (!t->defined && defined)
{
t->details.enumeration = xmalloc(sizeof(*t->details.enumeration));
t->details.enumeration->enums = enums;
t->defined = TRUE;
}
if (name)
{
if (defined)
reg_type(t, name, namespace, tsENUM);
}
return t;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment