WIDL: Add missing ignore attribute. Check for inapplicable
attributes in typedef.
Saveliy Tretiakov
saveliyt at mail.ru
Wed Mar 15 08:05:08 CST 2006
Sorry, previous patch was broken.
ChangeLog:
Saveliy Tretiakov <saveliyt at mail.ru>
Add missing ignore attribute.
Check for inapplicable attributes in typedef.
Register type in typelibrary only when ATTR_PUBLIC is set.
-------------- next part --------------
Index: tools/widl/parser.l
===================================================================
RCS file: /home/wine/wine/tools/widl/parser.l,v
retrieving revision 1.35
diff -u -p -r1.35 parser.l
--- tools/widl/parser.l 9 Feb 2006 11:51:32 -0000 1.35
+++ tools/widl/parser.l 15 Mar 2006 13:48:51 -0000
@@ -228,6 +228,7 @@ static struct keyword {
{"hyper", tHYPER},
{"id", tID},
{"idempotent", tIDEMPOTENT},
+ {"ignore", tIGNORE },
/* ... */
{"iid_is", tIIDIS},
{"immediatebind", tIMMEDIATEBIND},
Index: tools/widl/parser.y
===================================================================
RCS file: /home/wine/wine/tools/widl/parser.y,v
retrieving revision 1.63
diff -u -p -r1.63 parser.y
--- tools/widl/parser.y 9 Feb 2006 11:51:32 -0000 1.63
+++ tools/widl/parser.y 15 Mar 2006 14:02:23 -0000
@@ -198,6 +198,7 @@ static type_t std_uhyper = { "MIDL_uhype
%token tVERSION
%token tVOID
%token tWCHAR tWIREMARSHAL
+%token tIGNORE
%type <attr> m_attributes attributes attrib_list attribute
%type <expr> m_exprs /* exprs expr_list */ m_expr expr expr_list_const expr_const
@@ -411,6 +412,7 @@ attribute:
| tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); }
| tWIREMARSHAL '(' type ')' { $$ = make_attrp(ATTR_WIREMARSHAL, type_ref($3)); }
| pointer_type { $$ = make_attrv(ATTR_POINTERTYPE, $1); }
+ | tIGNORE { $$ = make_attr(ATTR_IGNORE); }
;
callconv:
@@ -768,14 +770,36 @@ type: tVOID { $$ = make_tref(NULL,
| tUNION aIDENTIFIER { $$ = make_tref(NULL, find_type2($2, tsUNION)); }
;
-typedef: tTYPEDEF m_attributes type pident_list { typeref_t *tref = uniq_tref($3);
+typedef: tTYPEDEF m_attributes type pident_list {
+ attr_t *a = $2;
+ int public = 0;
+ while(a){
+ switch(a->type)
+ {
+ case ATTR_CONTEXTHANDLE:
+ case ATTR_STRING:
+ case ATTR_HANDLE:
+ case ATTR_SWITCHTYPE:
+ case ATTR_TRANSMITAS:
+ case ATTR_POINTERTYPE:
+ case ATTR_IGNORE:
+ break;
+ case ATTR_PUBLIC:
+ public = 1;
+ break;
+ default:
+ yyerror("Inapplicable attribute\n");
+ }
+ a = NEXT_LINK(a);
+ }
+ typeref_t *tref = uniq_tref($3);
$4->tname = tref->name;
tref->name = NULL;
$$ = type_ref(tref);
$$->attrs = $2;
if (!parse_only && do_header)
write_typedef($$, $4);
- if (in_typelib && $$->attrs)
+ if (in_typelib && public)
add_typedef($$, $4);
reg_types($$, $4, 0);
}
Index: tools/widl/widltypes.h
===================================================================
RCS file: /home/wine/wine/tools/widl/widltypes.h,v
retrieving revision 1.36
diff -u -p -r1.36 widltypes.h
--- tools/widl/widltypes.h 9 Feb 2006 11:51:32 -0000 1.36
+++ tools/widl/widltypes.h 15 Mar 2006 13:48:00 -0000
@@ -123,7 +123,8 @@ enum attr_type
ATTR_V1ENUM,
ATTR_VARARG,
ATTR_VERSION,
- ATTR_WIREMARSHAL
+ ATTR_WIREMARSHAL,
+ ATTR_IGNORE
};
enum expr_type
More information about the wine-patches
mailing list