widl: Generate a name for the encapsulated union type.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Zebediah Figura 2019-08-21 11:18:06 -05:00 committed by Alexandre Julliard
parent 88207f0c11
commit 732f67ed38
3 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,6 @@ static var_t *reg_const(var_t *var);
static void push_namespace(const char *name);
static void pop_namespace(const char *name);
static char *gen_name(void);
static void check_arg_attrs(const var_t *arg);
static void check_statements(const statement_list_t *stmts, int is_inside_library);
static void check_all_user_types(const statement_list_t *stmts);
@ -2033,7 +2032,7 @@ var_t *find_const(const char *name, int f)
return cur->var;
}
static char *gen_name(void)
char *gen_name(void)
{
static const char format[] = "__WIDL_%s_generated_name_%08lX";
static unsigned long n = 0;

View File

@ -366,7 +366,7 @@ type_t *type_new_encapsulated_union(char *name, var_t *switch_field, var_t *unio
{
if (!union_field)
union_field = make_var(xstrdup("tagged_union"));
union_field->declspec.type = type_new_nonencapsulated_union(NULL, TRUE, cases);
union_field->declspec.type = type_new_nonencapsulated_union(gen_name(), TRUE, cases);
t->details.structure = xmalloc(sizeof(*t->details.structure));
t->details.structure->fields = append_var(NULL, switch_field);

View File

@ -51,6 +51,7 @@ void type_module_define(type_t *module, statement_list_t *stmts);
type_t *type_coclass_define(type_t *coclass, ifref_list_t *ifaces);
int type_is_equal(const type_t *type1, const type_t *type2);
const char *type_get_name(const type_t *type, enum name_type name_type);
char *gen_name(void);
/* FIXME: shouldn't need to export this */
type_t *duptype(type_t *t, int dupname);