Commit 9d878f22 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Add coclass and module types to the global namespace.

parent 13c39675
...@@ -96,20 +96,24 @@ type_t *type_new_alias(type_t *t, const char *name) ...@@ -96,20 +96,24 @@ type_t *type_new_alias(type_t *t, const char *name)
return a; return a;
} }
type_t *type_new_module(const char *name) type_t *type_new_module(char *name)
{ {
type_t *type = make_type(TYPE_MODULE); type_t *type = get_type(TYPE_MODULE, name, 0);
if (type->type_type != TYPE_MODULE || type->defined)
error_loc("%s: redefinition error; original definition was at %s:%d\n",
type->name, type->loc_info.input_name, type->loc_info.line_number);
type->name = name; type->name = name;
/* FIXME: register type to detect multiple definitions */
return type; return type;
} }
type_t *type_new_coclass(const char *name) type_t *type_new_coclass(char *name)
{ {
type_t *c = make_type(TYPE_COCLASS); type_t *type = get_type(TYPE_COCLASS, name, 0);
c->name = name; if (type->type_type != TYPE_COCLASS || type->defined)
/* FIXME: register type to detect multiple definitions */ error_loc("%s: redefinition error; original definition was at %s:%d\n",
return c; type->name, type->loc_info.input_name, type->loc_info.line_number);
type->name = name;
return type;
} }
......
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
type_t *type_new_function(var_list_t *args); type_t *type_new_function(var_list_t *args);
type_t *type_new_pointer(type_t *ref, attr_list_t *attrs); type_t *type_new_pointer(type_t *ref, attr_list_t *attrs);
type_t *type_new_alias(type_t *t, const char *name); type_t *type_new_alias(type_t *t, const char *name);
type_t *type_new_module(const char *name); type_t *type_new_module(char *name);
type_t *type_new_array(const char *name, type_t *element, int declptr, type_t *type_new_array(const char *name, type_t *element, int declptr,
unsigned int dim, expr_t *size_is, expr_t *length_is); unsigned int dim, expr_t *size_is, expr_t *length_is);
type_t *type_new_basic(enum type_basic_type basic_type); type_t *type_new_basic(enum type_basic_type basic_type);
type_t *type_new_int(enum type_basic_type basic_type, int sign); type_t *type_new_int(enum type_basic_type basic_type, int sign);
type_t *type_new_void(void); type_t *type_new_void(void);
type_t *type_new_coclass(const char *name); type_t *type_new_coclass(char *name);
type_t *type_new_enum(const char *name, int defined, var_list_t *enums); type_t *type_new_enum(const char *name, int defined, var_list_t *enums);
type_t *type_new_struct(char *name, int defined, var_list_t *fields); type_t *type_new_struct(char *name, int defined, var_list_t *fields);
type_t *type_new_nonencapsulated_union(const char *name, int defined, var_list_t *fields); type_t *type_new_nonencapsulated_union(const char *name, int defined, var_list_t *fields);
......
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