widl: Support coclass forward declarations.

oldstable
Robert Shearman 2006-06-06 20:05:39 +01:00 committed by Alexandre Julliard
parent 63c8dd4faf
commit 996c4f1f93
3 changed files with 11 additions and 0 deletions

View File

@ -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 );
}

View File

@ -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);

View File

@ -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 {}