From 5c9826505023b6594c692b6e7fc633cb96ab1ed0 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 18 Oct 2004 19:35:08 +0000 Subject: [PATCH] Added writing forward declaration of dispinterface. --- tools/widl/header.c | 3 ++- tools/widl/parser.y | 2 +- tools/widl/widltypes.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/widl/header.c b/tools/widl/header.c index 072952ea770..75becddf828 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -682,7 +682,8 @@ void write_forward(type_t *iface) * attributes - however, if we don't have a full definition at this point * (i.e. this is an IDL forward), then we also assume that it is an object * interface, since non-object interfaces shouldn't need forwards */ - if ((!iface->defined || is_object(iface->attrs)) && !iface->written) { + if ((!iface->defined || is_object(iface->attrs) || is_attr(iface->attrs, ATTR_DISPINTERFACE)) + && !iface->written) { fprintf(header,"#ifndef __%s_FWD_DEFINED__\n", iface->name); fprintf(header,"#define __%s_FWD_DEFINED__\n", iface->name); fprintf(header, "typedef struct %s %s;\n", iface->name, iface->name); diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 785cfb2c7cc..ad1a7af830e 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -595,7 +595,7 @@ dispinterface: tDISPINTERFACE aIDENTIFIER { $$ = get_type(0, $2, 0); } dispinterfacehdr: attributes dispinterface { $$ = $2; if ($$->defined) yyerror("multiple definition error\n"); $$->attrs = $1; - /* $$->attrs = make_attr(ATTR_DISPINTERFACE); */ + $$->attrs = make_attr(ATTR_DISPINTERFACE); /* LINK($$->attrs, $1); */ $$->ref = find_type("IDispatch", 0); if (!$$->ref) yyerror("IDispatch is undefined\n"); diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index 2ef1f77767a..433931bdbcb 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -98,6 +98,7 @@ enum attr_type ATTR_V1ENUM, ATTR_VERSION, ATTR_WIREMARSHAL, + ATTR_DISPINTERFACE }; enum expr_type -- 2.11.4.GIT