widl: Add support for the [overload] attribute.

The attribute is used by WinRT and doesn't have any
effect on the generated headers.

Signed-off-by: Bernhard Kölbl <besentv@gmail.com>
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Bernhard Kölbl 2022-01-25 17:07:28 +01:00 committed by Alexandre Julliard
parent 7a6ef5c2df
commit 64d5feb4ce
4 changed files with 7 additions and 0 deletions

View File

@ -403,6 +403,7 @@ static const struct keyword attr_keywords[] =
{"optimize", tOPTIMIZE, 0},
{"optional", tOPTIONAL, 0},
{"out", tOUT, 0},
{"overload", tOVERLOAD, 0},
{"partial_ignore", tPARTIALIGNORE, 0},
{"pointer_default", tPOINTERDEFAULT, 0},
{"progid", tPROGID, 0},

View File

@ -231,6 +231,7 @@ static typelib_t *current_typelib;
%token tOBJECT tODL tOLEAUTOMATION
%token tOPTIMIZE tOPTIONAL
%token tOUT
%token tOVERLOAD
%token tPARTIALIGNORE tPASCAL
%token tPOINTERDEFAULT
%token tPRAGMA_WARNING
@ -669,6 +670,7 @@ attribute: { $$ = NULL; }
| tOPTIMIZE '(' aSTRING ')' { $$ = make_attrp(ATTR_OPTIMIZE, $3); }
| tOPTIONAL { $$ = make_attr(ATTR_OPTIONAL); }
| tOUT { $$ = make_attr(ATTR_OUT); }
| tOVERLOAD '(' aSTRING ')' { $$ = make_attrp(ATTR_OVERLOAD, $3); }
| tPARTIALIGNORE { $$ = make_attr(ATTR_PARTIALIGNORE); }
| tPOINTERDEFAULT '(' pointer_type ')' { $$ = make_attrv(ATTR_POINTERDEFAULT, $3); }
| tPROGID '(' aSTRING ')' { $$ = make_attrp(ATTR_PROGID, $3); }
@ -2385,6 +2387,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_OPTIMIZE */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optimize" },
/* ATTR_OPTIONAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
/* ATTR_OUT */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
/* ATTR_OVERLOAD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "overload" },
/* ATTR_PARAMLCID */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
/* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" },
/* ATTR_POINTERDEFAULT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },

View File

@ -146,6 +146,7 @@ enum attr_type
ATTR_OPTIMIZE,
ATTR_OPTIONAL,
ATTR_OUT,
ATTR_OVERLOAD,
ATTR_PARAMLCID,
ATTR_PARTIALIGNORE,
ATTR_POINTERDEFAULT,

View File

@ -1419,6 +1419,8 @@ static int add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
break;
case ATTR_OUT:
break;
case ATTR_OVERLOAD:
break;
case ATTR_PROPGET:
invokekind = 0x2; /* INVOKE_PROPERTYGET */
break;