Needed for IDeviceInformationStatics, which is needed by Lenovo Ready For Assistant.
-- v2: widl: Add support for default_overload attribute.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for IDeviceInformationStatics. --- tools/widl/attribute.c | 1 + tools/widl/parser.l | 1 + tools/widl/parser.y | 2 ++ tools/widl/widltypes.h | 1 + tools/widl/write_msft.c | 1 + 5 files changed, 6 insertions(+)
diff --git a/tools/widl/attribute.c b/tools/widl/attribute.c index 5ea13a01175..bcd804e272f 100644 --- a/tools/widl/attribute.c +++ b/tools/widl/attribute.c @@ -153,6 +153,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_CUSTOM */ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, "custom" }, /* ATTR_DECODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "decode" }, /* ATTR_DEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "default" }, + /* ATTR_DEFAULT_OVERLOAD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "default_overload" }, /* ATTR_DEFAULTBIND */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultbind" }, /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" }, /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" }, diff --git a/tools/widl/parser.l b/tools/widl/parser.l index afbdf7151f0..951998de381 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -254,6 +254,7 @@ static void winrt_enable( int ns_prefix ) control { return tCONTROL; } custom { return tCUSTOM; } decode { return tDECODE; } + default_overload { return tDEFAULT_OVERLOAD; } defaultbind { return tDEFAULTBIND; } defaultcollelem { return tDEFAULTCOLLELEM; } defaultvalue { return tDEFAULTVALUE; } diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 26385a578b0..f66dc62492f 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -196,6 +196,7 @@ void pop_import( PARSER_LTYPE *yylloc ); %token tDECLARE %token tDECODE tDEFAULT tDEFAULTBIND %token tDELEGATE +%token tDEFAULT_OVERLOAD %token tDEFAULTCOLLELEM %token tDEFAULTVALUE %token tDEFAULTVTABLE @@ -662,6 +663,7 @@ attribute } | tDECODE { $$ = attr_int( @$, ATTR_DECODE, 0 ); } | tDEFAULT { $$ = attr_int( @$, ATTR_DEFAULT, 0 ); } + | tDEFAULT_OVERLOAD { $$ = attr_int( @$, ATTR_DEFAULT_OVERLOAD, 0 ); } | tDEFAULTBIND { $$ = attr_int( @$, ATTR_DEFAULTBIND, 0 ); } | tDEFAULTCOLLELEM { $$ = attr_int( @$, ATTR_DEFAULTCOLLELEM, 0 ); } | tDEFAULTVALUE '(' expr_const ')' { $$ = attr_ptr( @$, ATTR_DEFAULTVALUE, $3 ); } diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h index b92c8c15e68..1a26bb77cad 100644 --- a/tools/widl/widltypes.h +++ b/tools/widl/widltypes.h @@ -92,6 +92,7 @@ enum attr_type ATTR_CUSTOM, ATTR_DECODE, ATTR_DEFAULT, + ATTR_DEFAULT_OVERLOAD, ATTR_DEFAULTBIND, ATTR_DEFAULTCOLLELEM, ATTR_DEFAULTVALUE, diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c index a757af8adc9..063e293cdc4 100644 --- a/tools/widl/write_msft.c +++ b/tools/widl/write_msft.c @@ -1418,6 +1418,7 @@ static int add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) break; case ATTR_OUT: break; + case ATTR_DEFAULT_OVERLOAD: case ATTR_OVERLOAD: break; case ATTR_PROPGET:
On Wed Aug 2 07:38:23 2023 +0000, Rémi Bernon wrote:
I'm not completely sure the order still matters, but I suggest to keep it nonetheless and move default_overload before defaultbind.
Ah, I changed it from defaultoverload to default_overload and forgot to keep the order.
On Fri Aug 4 01:14:14 2023 +0000, Mohamad Al-Jaf wrote:
changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/3479/diffs?diff_id=61091&start_sha=d90871a40adc5e37a75b7c7b3afb89001d74d746#492b92cda3894bf22ea547a8673a16139f4127e7_200_201)
This was based on `explicit_handle`, which is named `ATTR_EXPLICIT_HANDLE` and `tEXPLICITHANDLE`, but yeah it is inconsistent.
Thanks for the review.
This merge request was approved by Rémi Bernon.