Commit 996c4f1f authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

widl: Support coclass forward declarations.

parent 63c8dd4f
......@@ -1004,3 +1004,11 @@ void write_coclass(class_t *cocl)
write_coclass_guid(cocl);
fprintf(header, "\n");
}
void write_coclass_forward(class_t *cocl)
{
fprintf(header, "#ifndef __%s_FWD_DEFINED__\n", cocl->name);
fprintf(header, "#define __%s_FWD_DEFINED__\n", cocl->name);
fprintf(header, "typedef struct %s %s;\n", cocl->name, cocl->name);
fprintf(header, "#endif /* defined __%s_FWD_DEFINED__\n\n", cocl->name );
}
......@@ -37,6 +37,7 @@ extern void write_forward(type_t *iface);
extern void write_interface(type_t *iface);
extern void write_dispinterface(type_t *iface);
extern void write_coclass(class_t *iface);
extern void write_coclass_forward(class_t *iface);
extern void write_typedef(type_t *type, const var_t *names);
extern void write_expr(FILE *h, const expr_t *e, int brackets);
extern void write_constdef(const var_t *v);
......
......@@ -239,6 +239,7 @@ input: gbl_statements { write_proxies($1); write_client
gbl_statements: { $$ = NULL; }
| gbl_statements interfacedec { $$ = $1; }
| gbl_statements interfacedef { $$ = make_ifref($2); LINK($$, $1); }
| gbl_statements coclass ';' { $$ = $1; if (!parse_only && do_header) write_coclass_forward($2); }
| gbl_statements coclassdef { $$ = $1; add_coclass($2); }
| gbl_statements moduledef { $$ = $1; add_module($2); }
| gbl_statements librarydef { $$ = $1; }
......@@ -248,6 +249,7 @@ gbl_statements: { $$ = NULL; }
imp_statements: {}
| imp_statements interfacedec { if (!parse_only) add_interface($2); }
| imp_statements interfacedef { if (!parse_only) add_interface($2); }
| imp_statements coclass ';' {}
| imp_statements coclassdef { if (!parse_only) add_coclass($2); }
| imp_statements moduledef { if (!parse_only) add_module($2); }
| imp_statements statement {}
......
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