diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 5a42263d32..bc252e84dd 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -918,8 +918,8 @@ interfacedec: | dispinterface ';' { $$ = $1; } ; -module: tMODULE aIDENTIFIER { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; } - | tMODULE aKNOWNTYPE { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; } +module: tMODULE aIDENTIFIER { $$ = type_new_module($2); } + | tMODULE aKNOWNTYPE { $$ = type_new_module($2); } ; modulehdr: attributes module { $$ = $2; diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c index e0ef86ebbe..979d3c73d2 100644 --- a/tools/widl/typelib.c +++ b/tools/widl/typelib.c @@ -209,9 +209,10 @@ unsigned short get_type_vt(type_t *t) case RPC_FC_CVSTRUCT: case RPC_FC_BOGUS_STRUCT: case RPC_FC_COCLASS: + case RPC_FC_MODULE: return VT_USERDEFINED; case 0: - return t->kind == TKIND_PRIMITIVE ? VT_VOID : VT_USERDEFINED; + return VT_VOID; default: error("get_type_vt: unknown type: 0x%02x\n", t->type); } diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index 67c6f8b97c..47ad1f5d61 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -70,6 +70,15 @@ type_t *type_new_alias(type_t *t, const char *name) return a; } +type_t *type_new_module(char *name) +{ + type_t *type = make_type(RPC_FC_MODULE, NULL); + type->name = name; + type->kind = TKIND_MODULE; + /* FIXME: register type to detect multiple definitions */ + return type; +} + static int compute_method_indexes(type_t *iface) { int idx; diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h index 24a15ea4ea..a0f819ab3f 100644 --- a/tools/widl/typetree.h +++ b/tools/widl/typetree.h @@ -27,6 +27,7 @@ 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_alias(type_t *t, const char *name); +type_t *type_new_module(char *name); void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stmts); void type_dispinterface_define(type_t *iface, var_list_t *props, func_list_t *methods); void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface); diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 3f06452549..7a55ee7e83 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -35,6 +35,7 @@ typedef GUID UUID; #define TRUE 1 #define FALSE 0 +#define RPC_FC_MODULE 0xfc #define RPC_FC_COCLASS 0xfd #define RPC_FC_FUNCTION 0xfe