Commit 64520ecd authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Move creation of module type into a separate function, type_new_module and…

widl: Move creation of module type into a separate function, type_new_module and give it a special FC type.
parent 8b326c4f
...@@ -918,8 +918,8 @@ interfacedec: ...@@ -918,8 +918,8 @@ interfacedec:
| dispinterface ';' { $$ = $1; } | dispinterface ';' { $$ = $1; }
; ;
module: tMODULE aIDENTIFIER { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; } module: tMODULE aIDENTIFIER { $$ = type_new_module($2); }
| tMODULE aKNOWNTYPE { $$ = make_type(0, NULL); $$->name = $2; $$->kind = TKIND_MODULE; } | tMODULE aKNOWNTYPE { $$ = type_new_module($2); }
; ;
modulehdr: attributes module { $$ = $2; modulehdr: attributes module { $$ = $2;
......
...@@ -209,9 +209,10 @@ unsigned short get_type_vt(type_t *t) ...@@ -209,9 +209,10 @@ unsigned short get_type_vt(type_t *t)
case RPC_FC_CVSTRUCT: case RPC_FC_CVSTRUCT:
case RPC_FC_BOGUS_STRUCT: case RPC_FC_BOGUS_STRUCT:
case RPC_FC_COCLASS: case RPC_FC_COCLASS:
case RPC_FC_MODULE:
return VT_USERDEFINED; return VT_USERDEFINED;
case 0: case 0:
return t->kind == TKIND_PRIMITIVE ? VT_VOID : VT_USERDEFINED; return VT_VOID;
default: default:
error("get_type_vt: unknown type: 0x%02x\n", t->type); error("get_type_vt: unknown type: 0x%02x\n", t->type);
} }
......
...@@ -70,6 +70,15 @@ type_t *type_new_alias(type_t *t, const char *name) ...@@ -70,6 +70,15 @@ type_t *type_new_alias(type_t *t, const char *name)
return a; 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) static int compute_method_indexes(type_t *iface)
{ {
int idx; int idx;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
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(char *name);
void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stmts); 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(type_t *iface, var_list_t *props, func_list_t *methods);
void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface); void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface);
......
...@@ -35,6 +35,7 @@ typedef GUID UUID; ...@@ -35,6 +35,7 @@ typedef GUID UUID;
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
#define RPC_FC_MODULE 0xfc
#define RPC_FC_COCLASS 0xfd #define RPC_FC_COCLASS 0xfd
#define RPC_FC_FUNCTION 0xfe #define RPC_FC_FUNCTION 0xfe
......
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