Bernhard Kölbl : widl: Add support for the [overload] attribute.
Alexandre Julliard
julliard at winehq.org
Tue Jan 25 15:41:19 CST 2022
Module: wine
Branch: master
Commit: 64d5feb4ce86a45941edecc5369546169a6f0549
URL: https://source.winehq.org/git/wine.git/?a=commit;h=64d5feb4ce86a45941edecc5369546169a6f0549
Author: Bernhard Kölbl <besentv at gmail.com>
Date: Tue Jan 25 17:07:28 2022 +0100
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 at gmail.com>
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/widl/parser.l | 1 +
tools/widl/parser.y | 3 +++
tools/widl/widltypes.h | 1 +
tools/widl/write_msft.c | 2 ++
4 files changed, 7 insertions(+)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 823d6f0acca..9286a494d4d 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -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},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 82cf946e8fb..d6ac73cbf00 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -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" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 8df927fea4c..e345730731a 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -146,6 +146,7 @@ enum attr_type
ATTR_OPTIMIZE,
ATTR_OPTIONAL,
ATTR_OUT,
+ ATTR_OVERLOAD,
ATTR_PARAMLCID,
ATTR_PARTIALIGNORE,
ATTR_POINTERDEFAULT,
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index 610f781ba76..abeb37f34a4 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -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;
More information about the wine-cvs
mailing list