Updated widl-winrt-support patchset

Thanks Rémi Bernon.
This commit is contained in:
Alistair Leslie-Hughes 2020-11-25 21:54:30 +11:00
parent 991f2e8ebf
commit 3553024da0
32 changed files with 1955 additions and 1441 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "4807a8f588c67e2296474399368a96c0046120fd"
echo "92fb63d7754ba56b2604d253b600284c52ab82c6"
}
# Show version information
@ -259,6 +259,11 @@ patch_enable_all ()
enable_uxtheme_CloseThemeClass="$1"
enable_version_VerQueryValue="$1"
enable_widl_SLTG_Typelib_Support="$1"
enable_widl_winrt_support="$1"
enable_windows_gaming_input_dll="$1"
enable_windows_globalization_dll="$1"
enable_windows_media_speech_dll="$1"
enable_windows_networking_connectivity_dll="$1"
enable_windowscodecs_GIF_Encoder="$1"
enable_windowscodecs_TIFF_Support="$1"
enable_wine_inf_Directory_ContextMenuHandlers="$1"
@ -853,6 +858,21 @@ patch_enable ()
widl-SLTG_Typelib_Support)
enable_widl_SLTG_Typelib_Support="$2"
;;
widl-winrt-support)
enable_widl_winrt_support="$2"
;;
windows.gaming.input-dll)
enable_windows_gaming_input_dll="$2"
;;
windows.globalization-dll)
enable_windows_globalization_dll="$2"
;;
windows.media.speech.dll)
enable_windows_media_speech_dll="$2"
;;
windows.networking.connectivity.dll)
enable_windows_networking_connectivity_dll="$2"
;;
windowscodecs-GIF_Encoder)
enable_windowscodecs_GIF_Encoder="$2"
;;
@ -1403,6 +1423,34 @@ if test "$enable_wineboot_ProxySettings" -eq 1; then
enable_wineboot_drivers_etc_Stubs=1
fi
if test "$enable_windows_networking_connectivity_dll" -eq 1; then
if test "$enable_windows_globalization_dll" -gt 1; then
abort "Patchset windows.globalization-dll disabled, but windows.networking.connectivity.dll depends on that."
fi
enable_windows_globalization_dll=1
fi
if test "$enable_windows_globalization_dll" -eq 1; then
if test "$enable_windows_gaming_input_dll" -gt 1; then
abort "Patchset windows.gaming.input-dll disabled, but windows.globalization-dll depends on that."
fi
enable_windows_gaming_input_dll=1
fi
if test "$enable_windows_gaming_input_dll" -eq 1; then
if test "$enable_windows_media_speech_dll" -gt 1; then
abort "Patchset windows.media.speech.dll disabled, but windows.gaming.input-dll depends on that."
fi
enable_windows_media_speech_dll=1
fi
if test "$enable_windows_media_speech_dll" -eq 1; then
if test "$enable_widl_winrt_support" -gt 1; then
abort "Patchset widl-winrt-support disabled, but windows.media.speech.dll depends on that."
fi
enable_widl_winrt_support=1
fi
if test "$enable_user32_window_activation" -eq 1; then
if test "$enable_user32_recursive_activation" -gt 1; then
abort "Patchset user32-recursive-activation disabled, but user32-window-activation depends on that."
@ -4179,6 +4227,130 @@ if test "$enable_version_VerQueryValue" -eq 1; then
patch_apply version-VerQueryValue/0001-version-Test-for-VerQueryValueA-try-2.patch
fi
# Patchset widl-winrt-support
# |
# | This patchset fixes the following Wine bugs:
# | * [#49998] widl - Support WinRT idls
# |
# | Modified files:
# | * include/Makefile.in, include/windows.foundation.idl, include/windows.media.speechsynthesis.idl,
# | include/windowscontracts.idl, tools/widl/expr.c, tools/widl/hash.c, tools/widl/hash.h, tools/widl/header.c,
# | tools/widl/parser.l, tools/widl/parser.y, tools/widl/typegen.c, tools/widl/typelib.c, tools/widl/typetree.c,
# | tools/widl/typetree.h, tools/widl/widltypes.h
# |
if test "$enable_widl_winrt_support" -eq 1; then
patch_apply widl-winrt-support/0001-widl-Introduce-format_namespace_buffer-helper.patch
patch_apply widl-winrt-support/0002-widl-Support-WinRT-contractversion-attribute-parsing.patch
patch_apply widl-winrt-support/0003-widl-Support-WinRT-apicontract-type.patch
patch_apply widl-winrt-support/0004-widl-Support-WinRT-contract-attribute.patch
patch_apply widl-winrt-support/0005-include-Add-windows.media.speechsynthesis.idl-draft.patch
patch_apply widl-winrt-support/0006-widl-Support-WinRT-marshaling_behavior-attribute-par.patch
patch_apply widl-winrt-support/0007-widl-Support-WinRT-mta-threading-attribute-parsing.patch
patch_apply widl-winrt-support/0008-widl-Support-WinRT-exclusiveto-attribute-parsing.patch
patch_apply widl-winrt-support/0009-widl-Support-WinRT-runtimeclass-type.patch
patch_apply widl-winrt-support/0010-widl-Support-WinRT-eventadd-eventremove-attributes.patch
patch_apply widl-winrt-support/0011-widl-Support-WinRT-flags-attribute-parsing.patch
patch_apply widl-winrt-support/0012-widl-Support-using-qualified-names-for-interfaces.patch
patch_apply widl-winrt-support/0013-widl-Support-WinRT-static-attribute-parsing.patch
patch_apply widl-winrt-support/0014-widl-Support-WinRT-requires-keyword.patch
patch_apply widl-winrt-support/0015-widl-Support-WinRT-activatable-attribute.patch
patch_apply widl-winrt-support/0016-widl-Support-WinRT-parameterized-type-parsing.patch
patch_apply widl-winrt-support/0017-widl-Support-partially-specialized-parameterized-typ.patch
patch_apply widl-winrt-support/0018-widl-Support-WinRT-parameterized-interface-type.patch
patch_apply widl-winrt-support/0019-widl-Support-WinRT-delegate-type.patch
patch_apply widl-winrt-support/0020-widl-Support-WinRT-parameterized-delegate-type.patch
patch_apply widl-winrt-support/0021-widl-Compute-signatures-for-parameterized-types.patch
patch_apply widl-winrt-support/0022-widl-Compute-uuids-for-parameterized-types.patch
patch_apply widl-winrt-support/0023-widl-Generate-helper-macros-for-WinRT-implementation.patch
patch_apply widl-winrt-support/0024-include-Add-IVectorView-HSTRING-declaration-to-windo.patch
fi
# Patchset windows.media.speech.dll
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * widl-winrt-support
# |
# | This patchset fixes the following Wine bugs:
# | * [#49740] windows.media.speech: New DLL
# |
# | Modified files:
# | * configure.ac, dlls/windows.media.speech.dll/Makefile.in, dlls/windows.media.speech.dll/windows.media.speech.spec,
# | dlls/windows.media.speech.dll/windows.media.speech_main.c, loader/wine.inf.in
# |
if test "$enable_windows_media_speech_dll" -eq 1; then
patch_apply windows.media.speech.dll/0001-windows.media.speech-Add-stub-dll.patch
patch_apply windows.media.speech.dll/0002-windows.media.speech-Implement-IInstalledVoicesStati.patch
patch_apply windows.media.speech.dll/0003-windows.media.speech-Implement-IInstalledVoicesStati.patch
patch_apply windows.media.speech.dll/0004-windows.media.speech-Fake-empty-IInstalledVoicesStat.patch
fi
# Patchset windows.gaming.input-dll
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * widl-winrt-support, windows.media.speech.dll
# |
# | This patchset fixes the following Wine bugs:
# | * [#49756] windows.gaming.input: New DLL
# |
# | Modified files:
# | * configure.ac, dlls/windows.gaming.input.dll/Makefile.in, dlls/windows.gaming.input.dll/windows.gaming.input.spec,
# | dlls/windows.gaming.input.dll/windows.gaming.input_main.c, include/Makefile.in, include/asyncinfo.idl,
# | include/windows.foundation.idl, include/windows.gaming.input.forcefeedback.idl, include/windows.gaming.input.idl,
# | include/windows.system.idl, loader/wine.inf.in
# |
if test "$enable_windows_gaming_input_dll" -eq 1; then
patch_apply windows.gaming.input-dll/0001-windows.gaming.input-Add-stub-dll.patch
patch_apply windows.gaming.input-dll/0002-windows.gaming.input-Implement-IGamepadStatics-stubs.patch
patch_apply windows.gaming.input-dll/0003-windows.gaming.input-Implement-IGamepadStatics-Gamep.patch
patch_apply windows.gaming.input-dll/0004-windows.gaming.input-Fake-empty-IGamepadStatics-Game.patch
patch_apply windows.gaming.input-dll/0005-windows.gaming.input-Fake-IEventHandler_Gamepad-supp.patch
patch_apply windows.gaming.input-dll/0006-windows.gaming.input-Implement-IRawGameControllerSta.patch
patch_apply windows.gaming.input-dll/0007-windows.gaming.input-Implement-IRawGameControllerSta.patch
patch_apply windows.gaming.input-dll/0008-windows.gaming.input-Fake-empty-IRawGameControllerSt.patch
patch_apply windows.gaming.input-dll/0009-windows.gaming.input-Fake-IEventHandler_RawGameContr.patch
fi
# Patchset windows.globalization-dll
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * widl-winrt-support, windows.media.speech.dll, windows.gaming.input-dll
# |
# | This patchset fixes the following Wine bugs:
# | * [#49740] windows.globalization: New DLL
# | * [#49998] windows.globalization: New DLL
# |
# | Modified files:
# | * configure.ac, dlls/windows.globalization.dll/Makefile.in, dlls/windows.globalization.dll/windows.globalization.spec,
# | dlls/windows.globalization.dll/windows.globalization_main.c, include/Makefile.in, include/windows.globalization.idl,
# | include/windows.system.userprofile.idl, loader/wine.inf.in
# |
if test "$enable_windows_globalization_dll" -eq 1; then
patch_apply windows.globalization-dll/0001-windows.globalization-Add-stub-dll.patch
patch_apply windows.globalization-dll/0002-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0003-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0004-windows.globalization-Implement-IGlobalizationPrefer.patch
patch_apply windows.globalization-dll/0005-windows.globalization-Fake-empty-IGlobalizationPrefe.patch
fi
# Patchset windows.networking.connectivity.dll
# |
# | This patchset has the following (direct or indirect) dependencies:
# | * widl-winrt-support, windows.media.speech.dll, windows.gaming.input-dll, windows.globalization-dll
# |
# | This patchset fixes the following Wine bugs:
# | * [#46534] windows.networking.connectivity: New DLL
# |
# | Modified files:
# | * configure.ac, dlls/windows.networking.connectivity.dll/Makefile.in,
# | dlls/windows.networking.connectivity.dll/windows.networking.connectivity.spec,
# | dlls/windows.networking.connectivity.dll/windows.networking.connectivity_main.c, loader/wine.inf.in
# |
if test "$enable_windows_networking_connectivity_dll" -eq 1; then
patch_apply windows.networking.connectivity.dll/0001-windows.networking.connectivity-Add-stub-dll.patch
patch_apply windows.networking.connectivity.dll/0002-windows.networking.connectivity-Implement-IActivatio.patch
patch_apply windows.networking.connectivity.dll/0003-windows.networking.connectivity-Implement-INetworkIn.patch
fi
# Patchset windowscodecs-GIF_Encoder
# |
# | Modified files:

View File

@ -1,7 +1,7 @@
From ee1ce628835376e5054972ef3c39996a2b015309 Mon Sep 17 00:00:00 2001
From ba7d12c53e656fcc0dd638a7758d60a332d3bb7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 23 Sep 2020 14:14:01 +0200
Subject: [PATCH 03/28] widl: Introduce format_namespace_buffer helper.
Subject: [PATCH] widl: Introduce format_namespace_buffer helper.
To compute format_namespace length and write to an existing buffer.
@ -9,12 +9,12 @@ Also add explicit abi_prefix parameter.
---
tools/widl/header.c | 2 +-
tools/widl/parser.y | 2 +-
tools/widl/typetree.c | 54 +++++++++++++++++++-----------------------
tools/widl/typetree.c | 58 +++++++++++++++++++++---------------------
tools/widl/widltypes.h | 3 ++-
4 files changed, 29 insertions(+), 32 deletions(-)
4 files changed, 33 insertions(+), 32 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 743d86f0ee9..d67fea4cc95 100644
index 015bbe2ece7..a892243fb54 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -132,7 +132,7 @@ static void write_guid(FILE *f, const char *guid_prefix, const char *name, const
@ -27,10 +27,10 @@ index 743d86f0ee9..d67fea4cc95 100644
fprintf(f, "__CRT_UUID_DECL(%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x)\n",
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 5bc0d82703e..306e5194467 100644
index 160e4029a6e..1bbb2e78f7e 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1905,7 +1905,7 @@ type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, in
@@ -1922,7 +1922,7 @@ type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, in
if (is_global_namespace(namespace))
type->c_name = name;
else
@ -40,15 +40,23 @@ index 5bc0d82703e..306e5194467 100644
nt->t = t;
nt->next = namespace->type_hash[hash];
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index e9afc6fdd28..ebba2c4c6bb 100644
index c0547b36a96..d211fa8d277 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -89,41 +89,37 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
@@ -89,41 +89,41 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
return NULL;
}
-static char *append_namespace(char *ptr, struct namespace *namespace, const char *separator)
-{
+#define append_buf(f, ...) \
+ do { \
+ int r = f(buf + ret, max(ret, len) - ret, ## __VA_ARGS__); \
+ assert(r >= 0); \
+ ret += r; \
+ } while(0)
+
+static int append_namespace(char *buf, size_t len, struct namespace *namespace, const char *separator, const char *abi_prefix)
{
- if(is_global_namespace(namespace)) {
- if(!use_abi_namespace)
- return ptr;
@ -56,15 +64,11 @@ index e9afc6fdd28..ebba2c4c6bb 100644
- strcat(ptr, separator);
- return ptr + strlen(ptr);
- }
+#define append_buf(f, ...) \
+ do { int r = f(buf + ret, max(ret, len) - ret, __VA_ARGS__); assert(r >= 0); ret += r; } while(0)
-
- ptr = append_namespace(ptr, namespace->parent, separator);
- strcpy(ptr, namespace->name);
- strcat(ptr, separator);
- return ptr + strlen(ptr);
+static int append_namespace(char *buf, size_t len, struct namespace *namespace, const char *separator, const char *abi_prefix)
+{
+ const char *name = namespace && !is_global_namespace(namespace) ? namespace->name : abi_prefix;
+ int ret = 0;
+ if (!name) return 0;
@ -111,10 +115,10 @@ index e9afc6fdd28..ebba2c4c6bb 100644
type_t *type_new_function(var_list_t *args)
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 085a0ff55f5..630f42860f1 100644
index b02b80e122c..7a43e517698 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -605,7 +605,8 @@ var_list_t *append_var(var_list_t *list, var_t *var);
@@ -613,7 +613,8 @@ var_list_t *append_var(var_list_t *list, var_t *var);
void init_loc_info(loc_info_t *);
@ -125,5 +129,5 @@ index 085a0ff55f5..630f42860f1 100644
static inline enum type_type type_get_type_detect_alias(const type_t *type)
{
--
2.28.0
2.29.2

View File

@ -0,0 +1,89 @@
From 724457cf02d0e14878bcb2354732656637141f8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 14:04:28 +0200
Subject: [PATCH] widl: Support WinRT contractversion attribute parsing.
---
tools/widl/parser.l | 1 +
tools/widl/parser.y | 12 +++++++++++-
tools/widl/widltypes.h | 1 +
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index d7d96702322..a4e1d0d2c47 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -338,6 +338,7 @@ static const struct keyword attr_keywords[] =
{"context_handle", tCONTEXTHANDLE, 0},
{"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE, 0},
{"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE, 0},
+ {"contractversion", tCONTRACTVERSION, 1},
{"control", tCONTROL, 0},
{"custom", tCUSTOM, 0},
{"decode", tDECODE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 1bbb2e78f7e..3c4c8041a1c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -177,7 +177,9 @@ static typelib_t *current_typelib;
%token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
%token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
%token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE
-%token tCONTEXTHANDLESERIALIZE tCONTROL tCPPQUOTE
+%token tCONTEXTHANDLESERIALIZE
+%token tCONTRACTVERSION
+%token tCONTROL tCPPQUOTE
%token tCUSTOM
%token tDECODE tDEFAULT tDEFAULTBIND
%token tDEFAULTCOLLELEM
@@ -290,6 +292,7 @@ static typelib_t *current_typelib;
%type <declarator> m_abstract_declarator abstract_declarator abstract_declarator_no_direct abstract_direct_declarator
%type <declarator_list> declarator_list struct_declarator_list
%type <type> coclass coclasshdr coclassdef
+%type <num> contract_ver
%type <num> pointer_type threading_type version
%type <str> libraryhdr callconv cppquote importlib import t_ident
%type <uuid> uuid_string
@@ -492,6 +495,11 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); }
| str_list ',' aSTRING { $$ = append_str( $1, $3 ); }
;
+contract_ver:
+ aNUM { $$ = MAKEVERSION(0, $1); }
+ | aNUM '.' aNUM { $$ = MAKEVERSION($3, $1); }
+ ;
+
attribute: { $$ = NULL; }
| tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); }
| tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); }
@@ -507,6 +515,7 @@ attribute: { $$ = NULL; }
| tCONTEXTHANDLE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); }
| tCONTEXTHANDLENOSERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ }
| tCONTEXTHANDLESERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
+ | tCONTRACTVERSION '(' contract_ver ')' { $$ = make_attrv(ATTR_CONTRACTVERSION, $3); }
| tCONTROL { $$ = make_attr(ATTR_CONTROL); }
| tCUSTOM '(' uuid_string ',' expr_const ')' { $$ = make_custom_attr($3, $5); }
| tDECODE { $$ = make_attr(ATTR_DECODE); }
@@ -2155,6 +2164,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_CODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
/* ATTR_COMMSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
/* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
+ /* ATTR_CONTRACTVERSION */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "contractversion" },
/* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
/* ATTR_CUSTOM */ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, "custom" },
/* ATTR_DECODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "decode" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 7a43e517698..78401cf8278 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -84,6 +84,7 @@ enum attr_type
ATTR_CODE,
ATTR_COMMSTATUS,
ATTR_CONTEXTHANDLE,
+ ATTR_CONTRACTVERSION,
ATTR_CONTROL,
ATTR_CUSTOM,
ATTR_DECODE,
--
2.29.2

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,21 @@
From 8a97a7f01dcf01f089dd65dc7739718db8bea07c Mon Sep 17 00:00:00 2001
From 1b6d9ab9462963fd6465840a726fadf2ad612bcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 23 Sep 2020 19:23:45 +0200
Subject: [PATCH] widl: Support WinRT contract attribute.
---
include/windows.foundation.idl | 14 ++---
include/windows.media.speechsynthesis.idl | 13 ++++
tools/widl/header.c | 72 ++++++++++++++++++++++-
tools/widl/parser.l | 1 +
tools/widl/parser.y | 9 +++
tools/widl/widltypes.h | 1 +
6 files changed, 100 insertions(+), 10 deletions(-)
include/windows.foundation.idl | 14 +++----
tools/widl/header.c | 72 ++++++++++++++++++++++++++++++++--
tools/widl/parser.l | 1 +
tools/widl/parser.y | 10 +++++
tools/widl/widltypes.h | 1 +
5 files changed, 88 insertions(+), 10 deletions(-)
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
index 2c16fa2da22..c08334ed660 100644
index 2a38e9f671b..5e17062f399 100644
--- a/include/windows.foundation.idl
+++ b/include/windows.foundation.idl
@@ -27,7 +27,7 @@ import "inspectable.idl";
@@ -28,7 +28,7 @@ import "windowscontracts.idl";
namespace Windows {
namespace Foundation {
@ -25,7 +24,7 @@ index 2c16fa2da22..c08334ed660 100644
enum PropertyType {
Empty = 0,
UInt8 = 1,
@@ -72,19 +72,19 @@ namespace Windows {
@@ -73,19 +73,19 @@ namespace Windows {
OtherTypeArray = 1044
};
@ -48,7 +47,7 @@ index 2c16fa2da22..c08334ed660 100644
struct Rect {
FLOAT X;
FLOAT Y;
@@ -92,18 +92,18 @@ namespace Windows {
@@ -93,18 +93,18 @@ namespace Windows {
FLOAT Height;
};
@ -70,29 +69,8 @@ index 2c16fa2da22..c08334ed660 100644
uuid(96369f54-8eb6-48f0-abce-c1b211e627c3)
]
interface IStringable : IInspectable
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl
index d3dedfe0709..7a1de5fcba6 100644
--- a/include/windows.media.speechsynthesis.idl
+++ b/include/windows.media.speechsynthesis.idl
@@ -32,3 +32,16 @@ namespace Windows {
}
}
}
+
+namespace Windows {
+ namespace Media {
+ namespace SpeechSynthesis {
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)]
+ enum VoiceGender
+ {
+ Male = 0,
+ Female = 1
+ };
+ }
+ }
+}
diff --git a/tools/widl/header.c b/tools/widl/header.c
index a892243fb54..e1c48ae35ea 100644
index 657ce50c679..223ab5c5ca9 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -45,6 +45,11 @@ generic_handle_list_t generic_handle_list = LIST_INIT(generic_handle_list);
@ -145,7 +123,7 @@ index a892243fb54..e1c48ae35ea 100644
}
int needs_space_after(type_t *t)
@@ -555,7 +566,9 @@ static void write_type_definition(FILE *f, type_t *t, int declonly)
@@ -563,7 +574,9 @@ static void write_type_definition(FILE *f, type_t *t, int declonly)
int in_namespace = t->namespace && !is_global_namespace(t->namespace);
int save_written = t->written;
decl_spec_t ds = {.type = t};
@ -155,7 +133,7 @@ index a892243fb54..e1c48ae35ea 100644
if(in_namespace) {
fprintf(f, "#ifdef __cplusplus\n");
fprintf(f, "} /* extern \"C\" */\n");
@@ -573,6 +586,7 @@ static void write_type_definition(FILE *f, type_t *t, int declonly)
@@ -581,6 +594,7 @@ static void write_type_definition(FILE *f, type_t *t, int declonly)
fprintf(f, ";\n");
fprintf(f, "#endif\n\n");
}
@ -163,8 +141,8 @@ index a892243fb54..e1c48ae35ea 100644
}
void write_type_decl(FILE *f, const decl_spec_t *t, const char *name)
@@ -1452,12 +1466,55 @@ static void write_forward(FILE *header, type_t *iface)
fprintf(header, "#endif\n\n" );
@@ -1468,12 +1482,55 @@ static char *format_apicontract_macro(const type_t *type)
return name;
}
+static void write_winrt_type_comments(FILE *header, const type_t *type)
@ -219,7 +197,7 @@ index a892243fb54..e1c48ae35ea 100644
fprintf(header,"#ifndef __%s_%sINTERFACE_DEFINED__\n", iface->c_name, dispinterface ? "DISP" : "");
fprintf(header,"#define __%s_%sINTERFACE_DEFINED__\n\n", iface->c_name, dispinterface ? "DISP" : "");
}
@@ -1466,6 +1523,7 @@ static void write_com_interface_end(FILE *header, type_t *iface)
@@ -1482,6 +1539,7 @@ static void write_com_interface_end(FILE *header, type_t *iface)
{
int dispinterface = is_attr(iface->attrs, ATTR_DISPINTERFACE);
const UUID *uuid = get_attrp(iface->attrs, ATTR_UUID);
@ -227,7 +205,7 @@ index a892243fb54..e1c48ae35ea 100644
type_t *type;
if (uuid)
@@ -1543,17 +1601,22 @@ static void write_com_interface_end(FILE *header, type_t *iface)
@@ -1559,17 +1617,22 @@ static void write_com_interface_end(FILE *header, type_t *iface)
write_locals(header, iface, FALSE);
fprintf(header, "\n");
}
@ -251,7 +229,7 @@ index a892243fb54..e1c48ae35ea 100644
fprintf(header,"#ifndef __%s_INTERFACE_DEFINED__\n", iface->name);
fprintf(header,"#define __%s_INTERFACE_DEFINED__\n\n", iface->name);
if (var)
@@ -1578,7 +1641,10 @@ static void write_rpc_interface_start(FILE *header, const type_t *iface)
@@ -1594,7 +1657,10 @@ static void write_rpc_interface_start(FILE *header, const type_t *iface)
static void write_rpc_interface_end(FILE *header, const type_t *iface)
{
@ -264,22 +242,30 @@ index a892243fb54..e1c48ae35ea 100644
static void write_coclass(FILE *header, type_t *cocl)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index b715342ad59..c689b1cd400 100644
index 6a9bb65a483..9dce03577c6 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -338,6 +338,7 @@ static const struct keyword attr_keywords[] =
@@ -339,6 +339,7 @@ static const struct keyword attr_keywords[] =
{"context_handle", tCONTEXTHANDLE, 0},
{"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE, 0},
{"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE, 0},
+ {"contract", tCONTRACT, 1},
{"contractversion", tCONTRACTVERSION, 1},
{"control", tCONTROL, 0},
{"decode", tDECODE, 0},
{"defaultbind", tDEFAULTBIND, 0},
{"custom", tCUSTOM, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index bb29f976629..b6c24741f21 100644
index 5b4bd518a0b..1d413ca74f4 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -264,6 +264,7 @@ static typelib_t *current_typelib;
@@ -181,6 +181,7 @@ static typelib_t *current_typelib;
%token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
%token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE
%token tCONTEXTHANDLESERIALIZE
+%token tCONTRACT
%token tCONTRACTVERSION
%token tCONTROL tCPPQUOTE
%token tCUSTOM
@@ -271,6 +272,7 @@ static typelib_t *current_typelib;
%type <str_list> str_list
%type <expr> m_expr expr expr_const expr_int_const array m_bitfield
%type <expr_list> m_exprs /* exprs expr_list */ expr_list_int_const
@ -287,8 +273,8 @@ index bb29f976629..b6c24741f21 100644
%type <type> interfacehdr
%type <stgclass> storage_cls_spec
%type <type_qualifier> type_qualifier m_type_qual_list
@@ -490,6 +491,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); }
| str_list ',' aSTRING { $$ = append_str( $1, $3 ); }
@@ -508,6 +510,12 @@ contract_ver:
| aNUM '.' aNUM { $$ = MAKEVERSION($3, $1); }
;
+contract_req: decl_spec ',' contract_ver { if ($1->type->type_type != TYPE_APICONTRACT)
@ -300,34 +286,34 @@ index bb29f976629..b6c24741f21 100644
attribute: { $$ = NULL; }
| tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); }
| tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); }
@@ -505,6 +512,7 @@ attribute: { $$ = NULL; }
@@ -523,6 +531,7 @@ attribute: { $$ = NULL; }
| tCONTEXTHANDLE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); }
| tCONTEXTHANDLENOSERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ }
| tCONTEXTHANDLESERIALIZE { $$ = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ }
+ | tCONTRACT '(' contract_req ')' { $$ = make_attrp(ATTR_CONTRACT, $3); }
| tCONTRACTVERSION '(' contract_ver ')' { $$ = make_attrv(ATTR_CONTRACTVERSION, $3); }
| tCONTROL { $$ = make_attr(ATTR_CONTROL); }
| tDECODE { $$ = make_attr(ATTR_DECODE); }
| tDEFAULT { $$ = make_attr(ATTR_DEFAULT); }
@@ -2141,6 +2149,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_CODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
/* ATTR_COMMSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
/* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
+ /* ATTR_CONTRACT */ { 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, "contract" },
/* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" },
/* ATTR_DECODE */ { 0, 0, 0, 1, 1, 0, 1, 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, "default" },
| tCUSTOM '(' uuid_string ',' expr_const ')' { $$ = make_custom_attr($3, $5); }
@@ -2180,6 +2189,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_CODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
/* ATTR_COMMSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
/* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
+ /* ATTR_CONTRACT */ { 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, "contract" },
/* ATTR_CONTRACTVERSION */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "contractversion" },
/* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, "control" },
/* ATTR_CUSTOM */ { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, "custom" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 62d3c1faa00..5e93dc1275f 100644
index 878650d9c27..d5862426ad4 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -83,6 +83,7 @@ enum attr_type
@@ -84,6 +84,7 @@ enum attr_type
ATTR_CODE,
ATTR_COMMSTATUS,
ATTR_CONTEXTHANDLE,
+ ATTR_CONTRACT,
ATTR_CONTRACTVERSION,
ATTR_CONTROL,
ATTR_DECODE,
ATTR_DEFAULT,
ATTR_CUSTOM,
--
2.29.2

View File

@ -1,35 +1,32 @@
From 5dc312c4a09e51410c217919511b84323923607e Mon Sep 17 00:00:00 2001
From 01f45ef12247bf784f27b3edb78b5ce0969c50a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 23 Sep 2020 19:23:45 +0200
Subject: [PATCH 01/28] include: Add windows.media.speechsynthesis.idl draft.
Subject: [PATCH] include: Add windows.media.speechsynthesis.idl draft.
This IDL is used by windows.media.speech.dll, which is itself required
by Flight Simulator. It will here be used as an illustration and test
case for WIDL WinRT features.
---
include/Makefile.in | 1 +
include/windows.media.speechsynthesis.idl | 34 +++++++++++++++++++++++
2 files changed, 35 insertions(+)
include/windows.media.speechsynthesis.idl | 47 +++++++++++++++++++++++
2 files changed, 48 insertions(+)
create mode 100644 include/windows.media.speechsynthesis.idl
diff --git a/include/Makefile.in b/include/Makefile.in
index 23306689cab..d59b0be715d 100644
index a84e44998cc..1028ebcb3e4 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -735,6 +735,7 @@ SOURCES = \
@@ -743,6 +743,7 @@ SOURCES = \
windef.h \
windns.h \
windows.foundation.idl \
+ windows.media.speechsynthesis.idl \
windows.h \
windowscontracts.idl \
windowsx.h \
wine/debug.h \
diff --git a/include/windows.media.speechsynthesis.idl b/include/windows.media.speechsynthesis.idl
new file mode 100644
index 00000000000..d3dedfe0709
index 00000000000..7a1de5fcba6
--- /dev/null
+++ b/include/windows.media.speechsynthesis.idl
@@ -0,0 +1,34 @@
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2020 Rémi Bernon for CodeWeavers
+ *
@ -64,6 +61,19 @@ index 00000000000..d3dedfe0709
+ }
+ }
+}
+
+namespace Windows {
+ namespace Media {
+ namespace SpeechSynthesis {
+ [contract(Windows.Foundation.UniversalApiContract, 1.0)]
+ enum VoiceGender
+ {
+ Male = 0,
+ Female = 1
+ };
+ }
+ }
+}
--
2.28.0
2.29.2

View File

@ -1,4 +1,4 @@
From 8ae37dd05502ae83af4f0284181eabae88aad9ee Mon Sep 17 00:00:00 2001
From 96f79d868d6311262a9d30fe96b25cc120216531 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 20:34:28 +0200
Subject: [PATCH] widl: Support WinRT marshaling_behavior attribute parsing.
@ -6,15 +6,15 @@ Subject: [PATCH] widl: Support WinRT marshaling_behavior attribute parsing.
---
tools/widl/header.c | 7 +++++++
tools/widl/parser.l | 4 ++++
tools/widl/parser.y | 19 +++++++++++++++++--
tools/widl/parser.y | 18 ++++++++++++++++--
tools/widl/widltypes.h | 9 +++++++++
4 files changed, 37 insertions(+), 2 deletions(-)
4 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index e1c48ae35ea..9185477964e 100644
index 223ab5c5ca9..21f8528c31d 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1478,6 +1478,13 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
@@ -1494,6 +1494,13 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
fprintf(header, " * Introduced to %s in version %d.%d\n *\n", name, (ver >> 16) & 0xffff, ver & 0xffff);
free(name);
}
@ -29,10 +29,10 @@ index e1c48ae35ea..9185477964e 100644
static void write_apicontract_guard_start(FILE *header, const expr_t *expr)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index c689b1cd400..92f7c7844f3 100644
index 9dce03577c6..01c6f800a08 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -319,6 +319,7 @@ static const struct keyword keywords[] = {
@@ -320,6 +320,7 @@ static const struct keyword keywords[] = {
static const struct keyword attr_keywords[] =
{
{"aggregatable", tAGGREGATABLE, 0},
@ -40,7 +40,7 @@ index c689b1cd400..92f7c7844f3 100644
{"all_nodes", tALLNODES, 0},
{"allocate", tALLOCATE, 0},
{"annotation", tANNOTATION, 0},
@@ -378,12 +379,14 @@ static const struct keyword attr_keywords[] =
@@ -381,12 +382,14 @@ static const struct keyword attr_keywords[] =
{"length_is", tLENGTHIS, 0},
{"licensed", tLICENSED, 0},
{"local", tLOCAL, 0},
@ -55,7 +55,7 @@ index c689b1cd400..92f7c7844f3 100644
{"nonextensible", tNONEXTENSIBLE, 0},
{"notify", tNOTIFY, 0},
{"notify_flag", tNOTIFYFLAG, 0},
@@ -413,6 +416,7 @@ static const struct keyword attr_keywords[] =
@@ -416,6 +419,7 @@ static const struct keyword attr_keywords[] =
{"single_node", tSINGLENODE, 0},
{"size_is", tSIZEIS, 0},
{"source", tSOURCE, 0},
@ -64,22 +64,21 @@ index c689b1cd400..92f7c7844f3 100644
{"string", tSTRING, 0},
{"switch_is", tSWITCHIS, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index b6c24741f21..f3f71e9838a 100644
index 1d413ca74f4..a8160df900a 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -172,7 +172,10 @@ static typelib_t *current_typelib;
@@ -174,7 +174,9 @@ static typelib_t *current_typelib;
%token GREATEREQUAL LESSEQUAL
%token LOGICALOR LOGICALAND
%token ELLIPSIS
-%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION tAPPOBJECT tASYNC tASYNCUUID
+%token tAGGREGATABLE tALLNODES tAPPOBJECT tASYNC tASYNCUUID
+%token tAGGREGATABLE tALLNODES
-%token tAGGREGATABLE tALLNODES tALLOCATE tANNOTATION
+%token tAGGREGATABLE
+%token tAGILE
+%token tALLOCATE tANNOTATION
+%token tALLNODES tALLOCATE tANNOTATION
%token tAPICONTRACT
%token tAPPOBJECT tASYNC tASYNCUUID
%token tAUTOHANDLE tBINDABLE tBOOLEAN tBROADCAST tBYTE tBYTECOUNT
%token tCALLAS tCALLBACK tCASE tCDECL tCHAR tCOCLASS tCODE tCOMMSTATUS
%token tCONST tCONTEXTHANDLE tCONTEXTHANDLENOSERIALIZE
@@ -208,12 +211,14 @@ static typelib_t *current_typelib;
@@ -216,12 +218,14 @@ static typelib_t *current_typelib;
%token tLENGTHIS tLIBRARY
%token tLICENSED tLOCAL
%token tLONG
@ -94,7 +93,7 @@ index b6c24741f21..f3f71e9838a 100644
%token tNONEXTENSIBLE
%token tNOTIFY tNOTIFYFLAG
%token tNULL
@@ -239,6 +244,7 @@ static typelib_t *current_typelib;
@@ -247,6 +251,7 @@ static typelib_t *current_typelib;
%token tSIZEIS tSIZEOF
%token tSMALL
%token tSOURCE
@ -102,16 +101,16 @@ index b6c24741f21..f3f71e9838a 100644
%token tSTATIC
%token tSTDCALL
%token tSTRICTCONTEXTHANDLE
@@ -289,7 +295,7 @@ static typelib_t *current_typelib;
%type <declarator> m_abstract_declarator abstract_declarator abstract_declarator_no_direct abstract_direct_declarator
%type <declarator_list> declarator_list struct_declarator_list
@@ -299,7 +304,7 @@ static typelib_t *current_typelib;
%type <type> coclass coclasshdr coclassdef
%type <type> apicontract
%type <num> contract_ver
-%type <num> pointer_type threading_type version
+%type <num> pointer_type threading_type marshaling_behavior version
%type <str> libraryhdr callconv cppquote importlib import t_ident
%type <uuid> uuid_string
%type <import> import_start
@@ -491,6 +497,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); }
@@ -505,6 +510,12 @@ str_list: aSTRING { $$ = append_str( NULL, $1 ); }
| str_list ',' aSTRING { $$ = append_str( $1, $3 ); }
;
@ -121,10 +120,10 @@ index b6c24741f21..f3f71e9838a 100644
+ | tSTANDARD { $$ = MARSHALING_STANDARD; }
+ ;
+
contract_req: decl_spec ',' contract_ver { if ($1->type->type_type != TYPE_APICONTRACT)
error_loc("type %s is not an apicontract\n", $1->type->name);
$$ = make_exprl(EXPR_NUM, $3);
@@ -551,6 +563,8 @@ attribute: { $$ = NULL; }
contract_ver:
aNUM { $$ = MAKEVERSION(0, $1); }
| aNUM '.' aNUM { $$ = MAKEVERSION($3, $1); }
@@ -572,6 +583,8 @@ attribute: { $$ = NULL; }
| tLCID { $$ = make_attr(ATTR_PARAMLCID); }
| tLICENSED { $$ = make_attr(ATTR_LICENSED); }
| tLOCAL { $$ = make_attr(ATTR_LOCAL); }
@ -133,19 +132,19 @@ index b6c24741f21..f3f71e9838a 100644
| tMAYBE { $$ = make_attr(ATTR_MAYBE); }
| tMESSAGE { $$ = make_attr(ATTR_MESSAGE); }
| tNOCODE { $$ = make_attr(ATTR_NOCODE); }
@@ -2188,6 +2202,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
/* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" },
/* ATTR_LOCAL */ { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
+ /* ATTR_MARSHALING_BEHAVIOR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "marshaling_behavior" },
/* ATTR_MAYBE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
/* ATTR_MESSAGE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
/* ATTR_NOCODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
@@ -2230,6 +2243,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "lcid" },
/* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "licensed" },
/* ATTR_LOCAL */ { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
+ /* ATTR_MARSHALING_BEHAVIOR */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "marshaling_behavior" },
/* ATTR_MAYBE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
/* ATTR_MESSAGE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
/* ATTR_NOCODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 5e93dc1275f..c32b029e4a8 100644
index d5862426ad4..6c130d4701e 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -122,6 +122,7 @@ enum attr_type
@@ -125,6 +125,7 @@ enum attr_type
ATTR_LIBLCID,
ATTR_LICENSED,
ATTR_LOCAL,
@ -153,7 +152,7 @@ index 5e93dc1275f..c32b029e4a8 100644
ATTR_MAYBE,
ATTR_MESSAGE,
ATTR_NOCODE,
@@ -268,6 +269,14 @@ enum threading_type
@@ -271,6 +272,14 @@ enum threading_type
THREADING_BOTH
};

View File

@ -1,7 +1,7 @@
From d2013864b6a28fabca3678172ab95b95ab2bb9af Mon Sep 17 00:00:00 2001
From b7c63f88f9c751933f2734eda85da6bb90c2b4ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 11:35:49 +0200
Subject: [PATCH 10/28] widl: Support WinRT mta threading attribute parsing.
Subject: [PATCH] widl: Support WinRT mta threading attribute parsing.
---
tools/widl/header.c | 7 +++++++
@ -11,7 +11,7 @@ Subject: [PATCH 10/28] widl: Support WinRT mta threading attribute parsing.
4 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 6d5987bd4c1..843aba214a4 100644
index 21f8528c31d..3fa938192d3 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1494,6 +1494,13 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
@ -29,10 +29,10 @@ index 6d5987bd4c1..843aba214a4 100644
{
case MARSHALING_AGILE: fprintf(header, " * Class Marshaling Behavior: Agile - Class is agile\n *\n"); break;
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 39a19a3c1de..c99feffb5d6 100644
index 01c6f800a08..067966a85d4 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -382,6 +382,7 @@ static const struct keyword attr_keywords[] =
@@ -385,6 +385,7 @@ static const struct keyword attr_keywords[] =
{"marshaling_behavior", tMARSHALINGBEHAVIOR, 1},
{"maybe", tMAYBE, 0},
{"message", tMESSAGE, 0},
@ -41,10 +41,10 @@ index 39a19a3c1de..c99feffb5d6 100644
{"nocode", tNOCODE, 0},
{"nonbrowsable", tNONBROWSABLE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index ebaa0fc514b..a4ad03ef037 100644
index a8160df900a..caaa2f49d0c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -220,6 +220,7 @@ static typelib_t *current_typelib;
@@ -222,6 +222,7 @@ static typelib_t *current_typelib;
%token tMAYBE tMESSAGE
%token tMETHODS
%token tMODULE
@ -52,7 +52,7 @@ index ebaa0fc514b..a4ad03ef037 100644
%token tNAMESPACE
%token tNOCODE tNONBROWSABLE
%token tNONCREATABLE
@@ -1150,6 +1151,7 @@ threading_type:
@@ -1154,6 +1155,7 @@ threading_type:
| tSINGLE { $$ = THREADING_SINGLE; }
| tFREE { $$ = THREADING_FREE; }
| tBOTH { $$ = THREADING_BOTH; }
@ -61,10 +61,10 @@ index ebaa0fc514b..a4ad03ef037 100644
pointer_type:
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 62a018ab5a5..26634fa7f7d 100644
index 6c130d4701e..8a3bd00e340 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -266,7 +266,8 @@ enum threading_type
@@ -269,7 +269,8 @@ enum threading_type
THREADING_NEUTRAL,
THREADING_SINGLE,
THREADING_FREE,
@ -75,5 +75,5 @@ index 62a018ab5a5..26634fa7f7d 100644
enum marshaling_type
--
2.28.0
2.29.2

View File

@ -1,4 +1,4 @@
From 2a66f0891e81685b0eaf7dc9bcdd1cb60eb166af Mon Sep 17 00:00:00 2001
From b50209766aa6b602ebee9b7c17f274d30e238ee9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 00:11:08 +0200
Subject: [PATCH] widl: Support WinRT exclusiveto attribute parsing.
@ -11,10 +11,10 @@ Subject: [PATCH] widl: Support WinRT exclusiveto attribute parsing.
4 files changed, 12 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index d7efbe72a35..e18585615f2 100644
index 3fa938192d3..1d910364994 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1469,6 +1469,7 @@ static void write_forward(FILE *header, type_t *iface)
@@ -1485,6 +1485,7 @@ static char *format_apicontract_macro(const type_t *type)
static void write_winrt_type_comments(FILE *header, const type_t *type)
{
expr_t *contract = get_attrp(type->attrs, ATTR_CONTRACT);
@ -22,7 +22,7 @@ index d7efbe72a35..e18585615f2 100644
fprintf(header, " *\n");
if (contract)
{
@@ -1478,6 +1479,12 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
@@ -1494,6 +1495,12 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
fprintf(header, " * Introduced to %s in version %d.%d\n *\n", name, (ver >> 16) & 0xffff, ver & 0xffff);
free(name);
}
@ -36,10 +36,10 @@ index d7efbe72a35..e18585615f2 100644
{
case THREADING_SINGLE: fprintf(header, " * Class Threading Model: Single Threaded Apartment\n *\n"); break;
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 403886221a6..01ce16fa8c1 100644
index 067966a85d4..de25b7d12c4 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -355,6 +355,7 @@ static const struct keyword attr_keywords[] =
@@ -358,6 +358,7 @@ static const struct keyword attr_keywords[] =
{"encode", tENCODE, 0},
{"endpoint", tENDPOINT, 0},
{"entry", tENTRY, 0},
@ -48,10 +48,10 @@ index 403886221a6..01ce16fa8c1 100644
{"fault_status", tFAULTSTATUS, 0},
{"force_allocate", tFORCEALLOCATE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 7cef2abda80..986ecd4b29b 100644
index caaa2f49d0c..57f1e3f5301 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -189,6 +189,7 @@ static typelib_t *current_typelib;
@@ -196,6 +196,7 @@ static typelib_t *current_typelib;
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
%token tENABLEALLOCATE tENCODE tENDPOINT
%token tENTRY tENUM tERRORSTATUST
@ -59,7 +59,7 @@ index 7cef2abda80..986ecd4b29b 100644
%token tEXPLICITHANDLE tEXTERN
%token tFALSE
%token tFASTCALL tFAULTSTATUS
@@ -541,6 +542,7 @@ attribute: { $$ = NULL; }
@@ -561,6 +562,7 @@ attribute: { $$ = NULL; }
| tENCODE { $$ = make_attr(ATTR_ENCODE); }
| tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); }
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); }
@ -67,19 +67,19 @@ index 7cef2abda80..986ecd4b29b 100644
| tEXPLICITHANDLE { $$ = make_attr(ATTR_EXPLICIT_HANDLE); }
| tFAULTSTATUS { $$ = make_attr(ATTR_FAULTSTATUS); }
| tFORCEALLOCATE { $$ = make_attr(ATTR_FORCEALLOCATE); }
@@ -2182,6 +2184,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EXCLUSIVETO */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
/* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
@@ -2223,6 +2225,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
/* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 90a73af2bf5..6292ddc96db 100644
index 8a3bd00e340..7ad0cbea66f 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -100,6 +100,7 @@ enum attr_type
@@ -103,6 +103,7 @@ enum attr_type
ATTR_ENCODE,
ATTR_ENDPOINT,
ATTR_ENTRY,

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 2c2b50a97a60d7da4c1737f06fbd56d686aebcb8 Mon Sep 17 00:00:00 2001
From 8e4ce83c6e6b23b81c0ec70699fd1884b004dc73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Thu, 1 Oct 2020 20:10:02 +0200
Subject: [PATCH] widl: Support WinRT eventadd/eventremove attributes.
@ -11,7 +11,7 @@ Subject: [PATCH] widl: Support WinRT eventadd/eventremove attributes.
4 files changed, 15 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 065a82ea384..812becad63b 100644
index 93bcb4f5214..ae392fe7de4 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -187,6 +187,10 @@ const char *get_name(const var_t *v)
@ -26,10 +26,10 @@ index 065a82ea384..812becad63b 100644
return buffer = strmake( "get_%s", v->name );
if (is_attr( v->attrs, ATTR_PROPPUT ))
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 4fcba3f2301..74e55f0d6ab 100644
index 80a6bc38afb..4932e0adbe2 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -358,6 +358,8 @@ static const struct keyword attr_keywords[] =
@@ -359,6 +359,8 @@ static const struct keyword attr_keywords[] =
{"encode", tENCODE, 0},
{"endpoint", tENDPOINT, 0},
{"entry", tENTRY, 0},
@ -39,10 +39,10 @@ index 4fcba3f2301..74e55f0d6ab 100644
{"explicit_handle", tEXPLICITHANDLE, 0},
{"fault_status", tFAULTSTATUS, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 72b9d79cba1..fe35bde38e7 100644
index 93714ebf712..b19fb16efd0 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -195,6 +195,7 @@ static typelib_t *current_typelib;
@@ -197,6 +197,7 @@ static typelib_t *current_typelib;
%token tDLLNAME tDONTFREE tDOUBLE tDUAL
%token tENABLEALLOCATE tENCODE tENDPOINT
%token tENTRY tENUM tERRORSTATUST
@ -50,7 +50,7 @@ index 72b9d79cba1..fe35bde38e7 100644
%token tEXCLUSIVETO
%token tEXPLICITHANDLE tEXTERN
%token tFALSE
@@ -568,6 +569,8 @@ attribute: { $$ = NULL; }
@@ -571,6 +572,8 @@ attribute: { $$ = NULL; }
| tENCODE { $$ = make_attr(ATTR_ENCODE); }
| tENDPOINT '(' str_list ')' { $$ = make_attrp(ATTR_ENDPOINT, $3); }
| tENTRY '(' expr_const ')' { $$ = make_attrp(ATTR_ENTRY, $3); }
@ -59,16 +59,16 @@ index 72b9d79cba1..fe35bde38e7 100644
| tEXCLUSIVETO '(' decl_spec ')' { if ($3->type->type_type != TYPE_RUNTIMECLASS)
error_loc("type %s is not a runtimeclass\n", $3->type->name);
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
@@ -2260,6 +2263,8 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
/* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
/* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EVENTADD */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
+ /* ATTR_EVENTREMOVE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
/* ATTR_EXCLUSIVETO */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
@@ -2909,6 +2914,8 @@ static void check_functions(const type_t *iface, int is_inside_library)
@@ -2256,6 +2259,8 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
/* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
/* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EVENTADD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
+ /* ATTR_EVENTREMOVE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
@@ -2929,6 +2934,8 @@ static void check_functions(const type_t *iface, int is_inside_library)
{
if (func == func_iter) break;
if (strcmp(func->name, func_iter->name)) continue;
@ -78,10 +78,10 @@ index 72b9d79cba1..fe35bde38e7 100644
if (is_attr(func->attrs, ATTR_PROPPUT) != is_attr(func_iter->attrs, ATTR_PROPPUT)) continue;
if (is_attr(func->attrs, ATTR_PROPPUTREF) != is_attr(func_iter->attrs, ATTR_PROPPUTREF)) continue;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 3d8be66f4b8..b46fed49cd6 100644
index 77313b30c0f..75510ee50b1 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -101,6 +101,8 @@ enum attr_type
@@ -103,6 +103,8 @@ enum attr_type
ATTR_ENCODE,
ATTR_ENDPOINT,
ATTR_ENTRY,
@ -91,5 +91,5 @@ index 3d8be66f4b8..b46fed49cd6 100644
ATTR_EXPLICIT_HANDLE,
ATTR_FAULTSTATUS,
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From c64bd2a13a6ec07122d08bc81d4933b38eec5edf Mon Sep 17 00:00:00 2001
From 3fbc18351dcd54b48c1441e428a90efd8c68ffd5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 18:02:59 +0200
Subject: [PATCH 14/28] widl: Support WinRT flags attribute parsing.
Subject: [PATCH] widl: Support WinRT flags attribute parsing.
---
tools/widl/parser.l | 1 +
@ -10,10 +10,10 @@ Subject: [PATCH 14/28] widl: Support WinRT flags attribute parsing.
3 files changed, 5 insertions(+)
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 02a6b47e225..f5a57db4797 100644
index 4932e0adbe2..51142ded6e6 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -361,6 +361,7 @@ static const struct keyword attr_keywords[] =
@@ -364,6 +364,7 @@ static const struct keyword attr_keywords[] =
{"exclusiveto", tEXCLUSIVETO, 1},
{"explicit_handle", tEXPLICITHANDLE, 0},
{"fault_status", tFAULTSTATUS, 0},
@ -22,10 +22,10 @@ index 02a6b47e225..f5a57db4797 100644
{"free", tFREE, 0},
{"handle", tHANDLE, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index b1b3201042f..131226ba7be 100644
index b19fb16efd0..110b570f4e4 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -200,6 +200,7 @@ static typelib_t *current_typelib;
@@ -202,6 +202,7 @@ static typelib_t *current_typelib;
%token tEXPLICITHANDLE tEXTERN
%token tFALSE
%token tFASTCALL tFAULTSTATUS
@ -33,7 +33,7 @@ index b1b3201042f..131226ba7be 100644
%token tFLOAT tFORCEALLOCATE
%token tHANDLE
%token tHANDLET
@@ -575,6 +576,7 @@ attribute: { $$ = NULL; }
@@ -579,6 +580,7 @@ attribute: { $$ = NULL; }
$$ = make_attrp(ATTR_EXCLUSIVETO, $3->type); }
| tEXPLICITHANDLE { $$ = make_attr(ATTR_EXPLICIT_HANDLE); }
| tFAULTSTATUS { $$ = make_attr(ATTR_FAULTSTATUS); }
@ -41,19 +41,19 @@ index b1b3201042f..131226ba7be 100644
| tFORCEALLOCATE { $$ = make_attr(ATTR_FORCEALLOCATE); }
| tHANDLE { $$ = make_attr(ATTR_HANDLE); }
| tHELPCONTEXT '(' expr_int_const ')' { $$ = make_attrp(ATTR_HELPCONTEXT, $3); }
@@ -2243,6 +2245,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_EXCLUSIVETO */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
+ /* ATTR_FLAGS */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "flags" },
/* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
/* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
/* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpcontext" },
@@ -2264,6 +2266,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
/* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
/* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
+ /* ATTR_FLAGS */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "flags" },
/* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
/* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
/* ATTR_HELPCONTEXT */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpcontext" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index da70a8f97d5..0bf7b644fff 100644
index 75510ee50b1..a3283761256 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -105,6 +105,7 @@ enum attr_type
@@ -108,6 +108,7 @@ enum attr_type
ATTR_EXCLUSIVETO,
ATTR_EXPLICIT_HANDLE,
ATTR_FAULTSTATUS,
@ -62,5 +62,5 @@ index da70a8f97d5..0bf7b644fff 100644
ATTR_HANDLE,
ATTR_HELPCONTEXT,
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From 65fefdad1ecb8bc45a89bee1393acf2cfcbb63b8 Mon Sep 17 00:00:00 2001
From 9250fdc20535cf4126a953fc4eb6a95b40279efa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Fri, 25 Sep 2020 17:13:47 +0200
Subject: [PATCH 15/28] widl: Support using qualified names for interfaces.
Subject: [PATCH] widl: Support using qualified names for interfaces.
And make qualified name lookup more robust, only looking for types in
the lookup namespace if it's active.
@ -24,10 +24,10 @@ index 90bc9f279c6..89fe616b9b3 100644
}
}
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 131226ba7be..8e79ce3660f 100644
index 110b570f4e4..6f1a7a68e9c 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -74,6 +74,8 @@ static void append_chain_callconv(type_t *chain, char *callconv);
@@ -75,6 +75,8 @@ static void append_chain_callconv(type_t *chain, char *callconv);
static warning_list_t *append_warning(warning_list_t *, int);
static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs);
@ -36,7 +36,7 @@ index 131226ba7be..8e79ce3660f 100644
static type_t *find_type_or_error(const char *name, int t);
static type_t *find_type_or_error2(char *name, int t);
@@ -81,7 +83,6 @@ static var_t *reg_const(var_t *var);
@@ -82,7 +84,6 @@ static var_t *reg_const(var_t *var);
static void push_namespace(const char *name);
static void pop_namespace(const char *name);
@ -44,7 +44,7 @@ index 131226ba7be..8e79ce3660f 100644
static void push_lookup_namespace(const char *name);
static void check_arg_attrs(const var_t *arg);
@@ -293,7 +294,7 @@ static typelib_t *current_typelib;
@@ -295,7 +296,7 @@ static typelib_t *current_typelib;
%type <str> namespacedef
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
@ -53,7 +53,7 @@ index 131226ba7be..8e79ce3660f 100644
%type <ifref> class_interface
%type <ifref_list> class_interfaces
%type <var> arg ne_union_field union_field s_field case enum enum_member declaration
@@ -884,15 +885,15 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
@@ -888,15 +889,15 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
| tINT3264 { $$ = type_new_int(TYPE_BASIC_INT3264, 0); }
;
@ -76,7 +76,7 @@ index 131226ba7be..8e79ce3660f 100644
coclass: tCOCLASS aIDENTIFIER { $$ = type_new_coclass($2); }
| tCOCLASS aKNOWNTYPE { $$ = find_type($2, NULL, 0);
@@ -990,6 +991,8 @@ inherit: { $$ = NULL; }
@@ -994,6 +995,8 @@ inherit: { $$ = NULL; }
interface: tINTERFACE aIDENTIFIER { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); }
| tINTERFACE aKNOWNTYPE { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); }
@ -85,7 +85,7 @@ index 131226ba7be..8e79ce3660f 100644
;
interfacehdr: attributes interface { $$ = $2;
@@ -1953,12 +1956,6 @@ static void pop_namespace(const char *name)
@@ -1970,12 +1973,6 @@ static void pop_namespace(const char *name)
current_namespace = current_namespace->parent;
}
@ -98,7 +98,7 @@ index 131226ba7be..8e79ce3660f 100644
static void push_lookup_namespace(const char *name)
{
struct namespace *namespace;
@@ -2076,11 +2073,29 @@ type_t *find_type(const char *name, struct namespace *namespace, int t)
@@ -2093,11 +2090,29 @@ type_t *find_type(const char *name, struct namespace *namespace, int t)
return NULL;
}
@ -130,7 +130,7 @@ index 131226ba7be..8e79ce3660f 100644
{
error_loc("type '%s' not found\n", name);
return NULL;
@@ -2097,15 +2112,16 @@ static type_t *find_type_or_error2(char *name, int t)
@@ -2114,15 +2129,16 @@ static type_t *find_type_or_error2(char *name, int t)
int is_type(const char *name)
{
@ -152,5 +152,5 @@ index 131226ba7be..8e79ce3660f 100644
type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t)
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From ca0364f1bd90bb35821c6ffb620e502f2b4afb7a Mon Sep 17 00:00:00 2001
From 383521b26b11d59b9a45fd6b1d1fcb7744028595 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 14:30:32 +0200
Subject: [PATCH 17/28] widl: Support WinRT static attribute parsing.
Subject: [PATCH] widl: Support WinRT static attribute parsing.
---
tools/widl/header.c | 30 ++++++++++++++++++++++++++++++
@ -11,7 +11,7 @@ Subject: [PATCH 17/28] widl: Support WinRT static attribute parsing.
4 files changed, 40 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 812becad63b..3bc6b452177 100644
index ae392fe7de4..cb8231f213d 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -109,6 +109,17 @@ int is_attr(const attr_list_t *list, enum attr_type t)
@ -66,10 +66,10 @@ index 812becad63b..3bc6b452177 100644
{
ifref_list_t *ifaces = type_runtimeclass_get_ifaces(type);
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index f5a57db4797..90791543db2 100644
index 51142ded6e6..2695e8cf622 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -422,6 +422,7 @@ static const struct keyword attr_keywords[] =
@@ -426,6 +426,7 @@ static const struct keyword attr_keywords[] =
{"size_is", tSIZEIS, 0},
{"source", tSOURCE, 0},
{"standard", tSTANDARD, 1},
@ -78,10 +78,10 @@ index f5a57db4797..90791543db2 100644
{"string", tSTRING, 0},
{"switch_is", tSWITCHIS, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 1727b5bb396..e6e67826a8f 100644
index 6f1a7a68e9c..908e7b6d4da 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -283,6 +283,7 @@ static typelib_t *current_typelib;
@@ -285,6 +285,7 @@ static typelib_t *current_typelib;
%type <expr> m_expr expr expr_const expr_int_const array m_bitfield
%type <expr_list> m_exprs /* exprs expr_list */ expr_list_int_const
%type <expr> contract_req
@ -89,7 +89,7 @@ index 1727b5bb396..e6e67826a8f 100644
%type <type> interfacehdr
%type <stgclass> storage_cls_spec
%type <type_qualifier> type_qualifier m_type_qual_list
@@ -538,6 +539,11 @@ contract_req: decl_spec ',' contract_ver { if ($1->type->type_type != TYPE_APICO
@@ -541,6 +542,11 @@ contract_req: decl_spec ',' contract_ver { if ($1->type->type_type != TYPE_APICO
$$ = make_exprt(EXPR_GTREQL, declare_var(NULL, $1, make_declarator(NULL), 0), $$);
}
@ -101,7 +101,7 @@ index 1727b5bb396..e6e67826a8f 100644
attribute: { $$ = NULL; }
| tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); }
| tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); }
@@ -634,6 +640,7 @@ attribute: { $$ = NULL; }
@@ -638,6 +644,7 @@ attribute: { $$ = NULL; }
| tRETVAL { $$ = make_attr(ATTR_RETVAL); }
| tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); }
| tSOURCE { $$ = make_attr(ATTR_SOURCE); }
@ -109,7 +109,7 @@ index 1727b5bb396..e6e67826a8f 100644
| tSTRICTCONTEXTHANDLE { $$ = make_attr(ATTR_STRICTCONTEXTHANDLE); }
| tSTRING { $$ = make_attr(ATTR_STRING); }
| tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); }
@@ -2296,6 +2303,7 @@ struct allowed_attr allowed_attr[] =
@@ -2336,6 +2343,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_RETVAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
/* ATTR_SIZEIS */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "size_is" },
/* ATTR_SOURCE */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "source" },
@ -118,10 +118,10 @@ index 1727b5bb396..e6e67826a8f 100644
/* ATTR_STRING */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "string" },
/* ATTR_SWITCHIS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "switch_is" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 0bf7b644fff..aa3e6e75898 100644
index a3283761256..0e001f20cfb 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -159,6 +159,7 @@ enum attr_type
@@ -162,6 +162,7 @@ enum attr_type
ATTR_RETVAL,
ATTR_SIZEIS,
ATTR_SOURCE,
@ -130,5 +130,5 @@ index 0bf7b644fff..aa3e6e75898 100644
ATTR_STRING,
ATTR_SWITCHIS,
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From 0d3503123e3f0cb458ada24b052e1d39f1c4dddb Mon Sep 17 00:00:00 2001
From 1cdacef37ec25c6069b6cd6d1d8c9d1754b771fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 00:31:57 +0200
Subject: [PATCH 18/28] widl: Support WinRT requires keyword.
Subject: [PATCH] widl: Support WinRT requires keyword.
---
tools/widl/header.c | 13 +++++++++++
@ -13,7 +13,7 @@ Subject: [PATCH 18/28] widl: Support WinRT requires keyword.
6 files changed, 65 insertions(+), 13 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 3bc6b452177..5dfc5e2ff8c 100644
index cb8231f213d..78f17b0eee2 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1506,6 +1506,7 @@ static void write_winrt_type_comments(FILE *header, const type_t *type)
@ -44,7 +44,7 @@ index 3bc6b452177..5dfc5e2ff8c 100644
{
expr_t *expr;
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 90791543db2..2b41bea1bc9 100644
index 2695e8cf622..5b332abf455 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -298,6 +298,7 @@ static const struct keyword keywords[] = {
@ -56,7 +56,7 @@ index 90791543db2..2b41bea1bc9 100644
{"short", tSHORT, 0},
{"signed", tSIGNED, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index e6e67826a8f..1da667e0ced 100644
index 908e7b6d4da..bf89ba771ac 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -38,12 +38,6 @@
@ -81,7 +81,7 @@ index e6e67826a8f..1da667e0ced 100644
static attr_list_t *append_attr(attr_list_t *list, attr_t *attr);
static attr_list_t *append_attr_list(attr_list_t *new_list, attr_list_t *old_list);
static decl_spec_t *make_decl_spec(type_t *type, decl_spec_t *left, decl_spec_t *right,
@@ -140,6 +136,7 @@ static typelib_t *current_typelib;
@@ -141,6 +137,7 @@ static typelib_t *current_typelib;
expr_t *expr;
expr_list_t *expr_list;
type_t *type;
@ -89,7 +89,7 @@ index e6e67826a8f..1da667e0ced 100644
var_t *var;
var_list_t *var_list;
declarator_t *declarator;
@@ -247,6 +244,7 @@ static typelib_t *current_typelib;
@@ -249,6 +246,7 @@ static typelib_t *current_typelib;
%token tREADONLY tREF
%token tREGISTER tREPRESENTAS
%token tREQUESTEDIT
@ -97,7 +97,7 @@ index e6e67826a8f..1da667e0ced 100644
%token tRESTRICTED
%token tRETVAL
%token tRUNTIMECLASS
@@ -296,6 +294,7 @@ static typelib_t *current_typelib;
@@ -298,6 +296,7 @@ static typelib_t *current_typelib;
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
%type <type> type qualified_type
@ -105,7 +105,7 @@ index e6e67826a8f..1da667e0ced 100644
%type <ifref> class_interface
%type <ifref_list> class_interfaces
%type <var> arg ne_union_field union_field s_field case enum enum_member declaration
@@ -1009,19 +1008,27 @@ interfacehdr: attributes interface { $$ = $2;
@@ -1013,19 +1012,27 @@ interfacehdr: attributes interface { $$ = $2;
}
;
@ -137,7 +137,7 @@ index e6e67826a8f..1da667e0ced 100644
}
| dispinterfacedef semicolon_opt { $$ = $1; }
;
@@ -1317,6 +1324,26 @@ static str_list_t *append_str(str_list_t *list, char *str)
@@ -1344,6 +1351,26 @@ static str_list_t *append_str(str_list_t *list, char *str)
return list;
}
@ -164,7 +164,7 @@ index e6e67826a8f..1da667e0ced 100644
static attr_list_t *move_attr(attr_list_t *dst, attr_list_t *src, enum attr_type type)
{
attr_t *attr;
@@ -3015,7 +3042,7 @@ static void check_async_uuid(type_t *iface)
@@ -3058,7 +3085,7 @@ static void check_async_uuid(type_t *iface)
stmts = append_statement(stmts, make_statement_declaration(finish_func));
}
@ -174,10 +174,10 @@ index e6e67826a8f..1da667e0ced 100644
}
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index d075619448d..3d26fd23b26 100644
index 9bddba90681..85e745bee37 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -459,7 +459,7 @@ static unsigned int compute_method_indexes(type_t *iface)
@@ -463,7 +463,7 @@ static unsigned int compute_method_indexes(type_t *iface)
return idx;
}
@ -186,7 +186,7 @@ index d075619448d..3d26fd23b26 100644
{
iface->details.iface = xmalloc(sizeof(*iface->details.iface));
iface->details.iface->disp_props = NULL;
@@ -468,6 +468,7 @@ void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stm
@@ -472,6 +472,7 @@ void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stm
iface->details.iface->inherit = inherit;
iface->details.iface->disp_inherit = NULL;
iface->details.iface->async_iface = NULL;
@ -194,7 +194,7 @@ index d075619448d..3d26fd23b26 100644
iface->defined = TRUE;
compute_method_indexes(iface);
}
@@ -482,6 +483,7 @@ void type_dispinterface_define(type_t *iface, var_list_t *props, var_list_t *met
@@ -486,6 +487,7 @@ void type_dispinterface_define(type_t *iface, var_list_t *props, var_list_t *met
if (!iface->details.iface->inherit) error_loc("IDispatch is undefined\n");
iface->details.iface->disp_inherit = NULL;
iface->details.iface->async_iface = NULL;
@ -202,7 +202,7 @@ index d075619448d..3d26fd23b26 100644
iface->defined = TRUE;
compute_method_indexes(iface);
}
@@ -496,6 +498,7 @@ void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface)
@@ -500,6 +502,7 @@ void type_dispinterface_define_from_iface(type_t *dispiface, type_t *iface)
if (!dispiface->details.iface->inherit) error_loc("IDispatch is undefined\n");
dispiface->details.iface->disp_inherit = iface;
dispiface->details.iface->async_iface = NULL;
@ -238,10 +238,10 @@ index 951084cf875..8c555b91656 100644
{
type = type_get_real_type(type);
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index aa3e6e75898..be71886260b 100644
index 0e001f20cfb..1848e891643 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -378,6 +378,7 @@ struct iface_details
@@ -386,6 +386,7 @@ struct iface_details
struct _type_t *inherit;
struct _type_t *disp_inherit;
struct _type_t *async_iface;
@ -250,5 +250,5 @@ index aa3e6e75898..be71886260b 100644
struct module_details
--
2.28.0
2.29.2

View File

@ -1,4 +1,4 @@
From 0e9827b742b8592c539efe970e34977383ef14ba Mon Sep 17 00:00:00 2001
From 1b9a28bd1800db506745628cc718f4a84d185fb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 11:35:29 +0200
Subject: [PATCH] widl: Support WinRT activatable attribute.
@ -11,7 +11,7 @@ Subject: [PATCH] widl: Support WinRT activatable attribute.
4 files changed, 16 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 5dfc5e2ff8c..5c87a997349 100644
index 78f17b0eee2..dd4ba935af7 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1505,6 +1505,7 @@ static char *format_apicontract_macro(const type_t *type)
@ -40,7 +40,7 @@ index 5dfc5e2ff8c..5c87a997349 100644
{
char *name = format_namespace(exclusiveto->namespace, "", ".", exclusiveto->name, NULL);
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index ad4506017b2..34d24794ee0 100644
index 5b332abf455..0b6b51b847e 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -321,6 +321,7 @@ static const struct keyword keywords[] = {
@ -52,18 +52,18 @@ index ad4506017b2..34d24794ee0 100644
{"agile", tAGILE, 1},
{"all_nodes", tALLNODES, 0},
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 28fd8ca924a..7cc4be0bd4f 100644
index bf89ba771ac..4a464d28120 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -172,6 +172,7 @@ static typelib_t *current_typelib;
@@ -173,6 +173,7 @@ static typelib_t *current_typelib;
%token GREATEREQUAL LESSEQUAL
%token LOGICALOR LOGICALAND
%token ELLIPSIS
+%token tACTIVATABLE
%token tAGGREGATABLE tALLNODES
%token tAGGREGATABLE
%token tAGILE
%token tALLOCATE tANNOTATION
@@ -545,6 +546,7 @@ static_attr: decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTER
%token tALLNODES tALLOCATE tANNOTATION
@@ -547,6 +548,7 @@ static_attr: decl_spec ',' contract_req { if ($1->type->type_type != TYPE_INTER
}
attribute: { $$ = NULL; }
@ -71,7 +71,7 @@ index 28fd8ca924a..7cc4be0bd4f 100644
| tAGGREGATABLE { $$ = make_attr(ATTR_AGGREGATABLE); }
| tANNOTATION '(' aSTRING ')' { $$ = make_attrp(ATTR_ANNOTATION, $3); }
| tAPPOBJECT { $$ = make_attr(ATTR_APPOBJECT); }
@@ -2263,6 +2265,7 @@ struct allowed_attr
@@ -2277,6 +2279,7 @@ struct allowed_attr
struct allowed_attr allowed_attr[] =
{
/* attr { D ACF M I Fn ARG T En Enm St Un Fi L DI M C AC R <display name> } */
@ -80,10 +80,10 @@ index 28fd8ca924a..7cc4be0bd4f 100644
/* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" },
/* ATTR_ANNOTATION */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 894edfc0a1d..a8d41485d32 100644
index 1848e891643..345d1a90d01 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -68,6 +68,7 @@ typedef struct list warning_list_t;
@@ -69,6 +69,7 @@ typedef struct list warning_list_t;
enum attr_type
{
@ -92,5 +92,5 @@ index 894edfc0a1d..a8d41485d32 100644
ATTR_ALLOCATE,
ATTR_ANNOTATION,
--
2.28.0
2.29.2

View File

@ -1,7 +1,7 @@
From 46f497692aa6da875d56764538eefaadb9a8ec38 Mon Sep 17 00:00:00 2001
From 0f685576a7a76025edeae6c06f380c32c3e0541b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 16:31:16 +0200
Subject: [PATCH 20/28] widl: Support WinRT parameterized type parsing.
Subject: [PATCH] widl: Support WinRT parameterized type parsing.
And add IVectorView<T> and IIterator<T> parameterized interfaces to
windows.foundation.idl for illustration and future use. They won't
@ -17,14 +17,14 @@ source.
---
include/windows.foundation.idl | 29 +++++++++++++++++
tools/widl/expr.c | 2 ++
tools/widl/header.c | 10 +++---
tools/widl/header.c | 8 +++--
tools/widl/parser.y | 57 ++++++++++++++++++++++++++++++++--
tools/widl/typegen.c | 6 ++++
tools/widl/typelib.c | 2 ++
tools/widl/typetree.c | 30 ++++++++++++++++++
tools/widl/typetree.h | 4 +++
tools/widl/widltypes.h | 9 ++++++
9 files changed, 143 insertions(+), 6 deletions(-)
9 files changed, 142 insertions(+), 5 deletions(-)
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
index 5e17062f399..ab7c4753c3b 100644
@ -79,20 +79,18 @@ index 13bd5a889aa..c83e9aa5ec0 100644
break;
case TYPE_ALIAS:
diff --git a/tools/widl/header.c b/tools/widl/header.c
index 5c87a997349..283f2372fee 100644
index dd4ba935af7..4de34a59d22 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -501,7 +501,9 @@ void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, i
@@ -501,6 +501,8 @@ void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, i
break;
}
case TYPE_APICONTRACT:
- /* handled elsewhere */
+ case TYPE_PARAMETERIZED_TYPE:
+ case TYPE_PARAMETER:
+ /* handled elsewhere / shouldn't be here */
/* shouldn't be here */
assert(0);
break;
}
@@ -568,6 +570,8 @@ void write_type_right(FILE *h, type_t *t, int is_field)
case TYPE_RUNTIMECLASS:
break;
@ -115,10 +113,10 @@ index 5c87a997349..283f2372fee 100644
case STMT_TYPEREF:
/* FIXME: shouldn't write out forward declarations for undefined
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index d24f8881147..aa6ded5ba89 100644
index 4a464d28120..48135d4372e 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -80,6 +80,8 @@ static var_t *reg_const(var_t *var);
@@ -81,6 +81,8 @@ static var_t *reg_const(var_t *var);
static void push_namespace(const char *name);
static void pop_namespace(const char *name);
static void push_lookup_namespace(const char *name);
@ -127,7 +125,7 @@ index d24f8881147..aa6ded5ba89 100644
static void check_arg_attrs(const var_t *arg);
static void check_statements(const statement_list_t *stmts, int is_inside_library);
@@ -125,6 +127,7 @@ static struct namespace global_namespace = {
@@ -126,6 +128,7 @@ static struct namespace global_namespace = {
static struct namespace *current_namespace = &global_namespace;
static struct namespace *lookup_namespace = &global_namespace;
@ -135,7 +133,7 @@ index d24f8881147..aa6ded5ba89 100644
static typelib_t *current_typelib;
@@ -295,6 +298,8 @@ static typelib_t *current_typelib;
@@ -297,6 +300,8 @@ static typelib_t *current_typelib;
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
%type <type> type qualified_type
@ -144,7 +142,7 @@ index d24f8881147..aa6ded5ba89 100644
%type <typelist> requires required_types
%type <ifref> class_interface
%type <ifref_list> class_interfaces
@@ -1010,6 +1015,15 @@ interfacehdr: attributes interface { $$ = $2;
@@ -1014,6 +1019,15 @@ interfacehdr: attributes interface { $$ = $2;
}
;
@ -160,7 +158,7 @@ index d24f8881147..aa6ded5ba89 100644
required_types:
qualified_type { $$ = append_type(NULL, $1); }
| required_types ',' required_types { $$ = append_types($1, $3); }
@@ -1025,6 +1039,13 @@ interfacedef: interfacehdr inherit requires
@@ -1029,6 +1043,13 @@ interfacedef: interfacehdr inherit requires
type_interface_define($$, $2, $5, $3);
check_async_uuid($$);
}
@ -174,7 +172,7 @@ index d24f8881147..aa6ded5ba89 100644
/* MIDL is able to import the definition of a base class from inside the
* definition of a derived class, I'll try to support it with this rule */
| interfacehdr ':' aIDENTIFIER requires
@@ -1037,6 +1058,11 @@ interfacedef: interfacehdr inherit requires
@@ -1041,6 +1062,11 @@ interfacedef: interfacehdr inherit requires
interfacedec:
interface ';' { $$ = $1; }
@ -186,7 +184,7 @@ index d24f8881147..aa6ded5ba89 100644
| dispinterface ';' { $$ = $1; }
;
@@ -1979,6 +2005,29 @@ static void push_lookup_namespace(const char *name)
@@ -2017,6 +2043,29 @@ static void push_lookup_namespace(const char *name)
lookup_namespace = namespace;
}
@ -216,7 +214,7 @@ index d24f8881147..aa6ded5ba89 100644
struct rtype {
const char *name;
type_t *type;
@@ -2110,7 +2159,8 @@ static type_t *find_qualified_type_or_error(const char *name, int t)
@@ -2148,7 +2197,8 @@ static type_t *find_qualified_type_or_error(const char *name, int t)
static type_t *find_type_or_error(const char *name, int t)
{
type_t *type;
@ -226,7 +224,7 @@ index d24f8881147..aa6ded5ba89 100644
{
error_loc("type '%s' not found\n", name);
return NULL;
@@ -2130,7 +2180,8 @@ int is_type(const char *name)
@@ -2168,7 +2218,8 @@ int is_type(const char *name)
if (lookup_namespace != &global_namespace)
return find_type(name, lookup_namespace, 0) != NULL;
else
@ -236,7 +234,7 @@ index d24f8881147..aa6ded5ba89 100644
}
int is_namespace(const char *name)
@@ -2623,6 +2674,8 @@ static int is_allowed_conf_type(const type_t *type)
@@ -2666,6 +2717,8 @@ static int is_allowed_conf_type(const type_t *type)
case TYPE_RUNTIMECLASS:
return FALSE;
case TYPE_APICONTRACT:
@ -246,7 +244,7 @@ index d24f8881147..aa6ded5ba89 100644
assert(0);
break;
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 86c010aa6ae..f37b54eb65d 100644
index 2e9be0748c1..1b5fe16b6ec 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -377,6 +377,8 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att
@ -290,10 +288,10 @@ index ace6424e3a0..6f6c5f3ccc8 100644
assert(0);
break;
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index 3d26fd23b26..bbd519d98ab 100644
index 85e745bee37..429e61e43d9 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -459,6 +459,36 @@ static unsigned int compute_method_indexes(type_t *iface)
@@ -463,6 +463,36 @@ static unsigned int compute_method_indexes(type_t *iface)
return idx;
}
@ -353,10 +351,10 @@ index 8c555b91656..b04a67f6b47 100644
break;
}
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 7ca770b67ea..e2ffec6da8a 100644
index 345d1a90d01..8dd6958ba35 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -429,6 +429,12 @@ struct runtimeclass_details
@@ -437,6 +437,12 @@ struct runtimeclass_details
ifref_list_t *ifaces;
};
@ -369,7 +367,7 @@ index 7ca770b67ea..e2ffec6da8a 100644
#define HASHMAX 64
struct namespace {
@@ -457,6 +463,8 @@ enum type_type
@@ -465,6 +471,8 @@ enum type_type
TYPE_BITFIELD,
TYPE_APICONTRACT,
TYPE_RUNTIMECLASS,
@ -378,7 +376,7 @@ index 7ca770b67ea..e2ffec6da8a 100644
};
struct _type_t {
@@ -478,6 +486,7 @@ struct _type_t {
@@ -486,6 +494,7 @@ struct _type_t {
struct bitfield_details bitfield;
struct alias_details alias;
struct runtimeclass_details runtimeclass;
@ -387,5 +385,5 @@ index 7ca770b67ea..e2ffec6da8a 100644
const char *c_name;
unsigned int typestring_offset;
--
2.28.0
2.29.2

View File

@ -1,299 +0,0 @@
From c631587867eb72a1e166b016b08a7b1547e0c5a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 13 Oct 2020 13:52:34 +0200
Subject: [PATCH] widl: Support repeated attributes for WinRT static.
---
tools/widl/parser.y | 260 ++++++++++++++++++++++----------------------
1 file changed, 131 insertions(+), 129 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 37ab07ba1a3..eca878002ea 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1334,27 +1334,6 @@ static str_list_t *append_str(str_list_t *list, char *str)
return list;
}
-static attr_list_t *append_attr(attr_list_t *list, attr_t *attr)
-{
- attr_t *attr_existing;
- if (!attr) return list;
- if (!list)
- {
- list = xmalloc( sizeof(*list) );
- list_init( list );
- }
- LIST_FOR_EACH_ENTRY(attr_existing, list, attr_t, entry)
- if (attr_existing->type == attr->type)
- {
- parser_warning("duplicate attribute %s\n", get_attr_display_name(attr->type));
- /* use the last attribute, like MIDL does */
- list_remove(&attr_existing->entry);
- break;
- }
- list_add_tail( list, &attr->entry );
- return list;
-}
-
static attr_list_t *move_attr(attr_list_t *dst, attr_list_t *src, enum attr_type type)
{
attr_t *attr;
@@ -2227,6 +2206,8 @@ struct allowed_attr
{
unsigned int dce_compatible : 1;
unsigned int acf : 1;
+ unsigned int multiple : 1;
+
unsigned int on_interface : 1;
unsigned int on_function : 1;
unsigned int on_arg : 1;
@@ -2247,116 +2228,137 @@ struct allowed_attr
struct allowed_attr allowed_attr[] =
{
- /* attr { D ACF I Fn ARG T En Enm St Un Fi L DI M C AC R <display name> } */
- /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" },
- /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" },
- /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
- /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" },
- /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
- /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "async_uuid" },
- /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
- /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
- /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
- /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" },
- /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
- /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "case" },
- /* ATTR_CODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
- /* ATTR_COMMSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
- /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
- /* ATTR_CONTRACT */ { 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, "contract" },
- /* ATTR_CONTRACTVERSION */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "contractversion" },
- /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, "control" },
- /* ATTR_DECODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "decode" },
- /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, "default" },
- /* ATTR_DEFAULTBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultbind" },
- /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" },
- /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" },
- /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "defaultvtable" },
- /* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" },
- /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
- /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
- /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "dllname" },
- /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
- /* ATTR_ENABLEALLOCATE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "enable_allocate" },
- /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
- /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
- /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
- /* ATTR_EVENTADD */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
- /* ATTR_EVENTREMOVE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
- /* ATTR_EXCLUSIVETO */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
- /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
- /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
- /* ATTR_FLAGS */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "flags" },
- /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
- /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
- /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpcontext" },
- /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "helpfile" },
- /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpstring" },
- /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpstringcontext" },
- /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "helpstringdll" },
- /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, "hidden" },
- /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, "id" },
- /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
- /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "ignore" },
- /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "iid_is" },
- /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
- /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
- /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
- /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
- /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "length_is" },
- /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "lcid" },
- /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "licensed" },
- /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
- /* ATTR_MARSHALING_BEHAVIOR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "marshaling_behavior" },
- /* ATTR_MAYBE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
- /* ATTR_MESSAGE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
- /* ATTR_NOCODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
- /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
- /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "noncreatable" },
- /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
- /* ATTR_NOTIFY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify" },
- /* ATTR_NOTIFYFLAG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify_flag" },
- /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
- /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "odl" },
- /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
- /* ATTR_OPTIMIZE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optimize" },
- /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" },
- /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" },
- /* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" },
- /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" },
- /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" },
- /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "ref, unique or ptr" },
- /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "progid" },
- /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
- /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
- /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
- /* ATTR_PROXY */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "proxy" },
- /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "public" },
- /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "range" },
- /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "readonly" },
- /* ATTR_REPRESENTAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "represent_as" },
- /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
- /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, "restricted" },
- /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
- /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "size_is" },
- /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "source" },
- /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
- /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "string" },
- /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "switch_is" },
- /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "switch_type" },
- /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, "threading" },
- /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
- /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
- /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
- /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" },
- /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, "uuid" },
- /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
- /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
- /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 1, "version" },
- /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "vi_progid" },
- /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
+ /* attr { D ACF M I Fn ARG T En Enm St Un Fi L DI M C AC R <display name> } */
+ /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "aggregatable" },
+ /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" },
+ /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
+ /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "appobject" },
+ /* ATTR_ASYNC */ { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
+ /* ATTR_ASYNCUUID */ { 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "async_uuid" },
+ /* ATTR_AUTO_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
+ /* ATTR_BINDABLE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
+ /* ATTR_BROADCAST */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
+ /* ATTR_CALLAS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" },
+ /* ATTR_CALLCONV */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
+ /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "case" },
+ /* ATTR_CODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" },
+ /* ATTR_COMMSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" },
+ /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" },
+ /* ATTR_CONTRACT */ { 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, "contract" },
+ /* ATTR_CONTRACTVERSION */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "contractversion" },
+ /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, "control" },
+ /* 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_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" },
+ /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "defaultvtable" },
+ /* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" },
+ /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL },
+ /* ATTR_DISPLAYBIND */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" },
+ /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "dllname" },
+ /* ATTR_DUAL */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "dual" },
+ /* ATTR_ENABLEALLOCATE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "enable_allocate" },
+ /* ATTR_ENCODE */ { 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "encode" },
+ /* ATTR_ENDPOINT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" },
+ /* ATTR_ENTRY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" },
+ /* ATTR_EVENTADD */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventadd" },
+ /* ATTR_EVENTREMOVE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "eventremove" },
+ /* ATTR_EXCLUSIVETO */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "exclusive_to" },
+ /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" },
+ /* ATTR_FAULTSTATUS */ { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" },
+ /* ATTR_FLAGS */ { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "flags" },
+ /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" },
+ /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "handle" },
+ /* ATTR_HELPCONTEXT */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpcontext" },
+ /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "helpfile" },
+ /* ATTR_HELPSTRING */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpstring" },
+ /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, "helpstringcontext" },
+ /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "helpstringdll" },
+ /* ATTR_HIDDEN */ { 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, "hidden" },
+ /* ATTR_ID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, "id" },
+ /* ATTR_IDEMPOTENT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
+ /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "ignore" },
+ /* ATTR_IIDIS */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "iid_is" },
+ /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" },
+ /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
+ /* ATTR_IN */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
+ /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
+ /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "length_is" },
+ /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, "lcid" },
+ /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "licensed" },
+ /* ATTR_LOCAL */ { 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" },
+ /* ATTR_MARSHALING_BEHAVIOR */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "marshaling_behavior" },
+ /* ATTR_MAYBE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" },
+ /* ATTR_MESSAGE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" },
+ /* ATTR_NOCODE */ { 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" },
+ /* ATTR_NONBROWSABLE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" },
+ /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "noncreatable" },
+ /* ATTR_NONEXTENSIBLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" },
+ /* ATTR_NOTIFY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify" },
+ /* ATTR_NOTIFYFLAG */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify_flag" },
+ /* ATTR_OBJECT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" },
+ /* ATTR_ODL */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "odl" },
+ /* ATTR_OLEAUTOMATION */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" },
+ /* 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_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" },
+ /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "ref, unique or ptr" },
+ /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "progid" },
+ /* ATTR_PROPGET */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" },
+ /* ATTR_PROPPUT */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" },
+ /* ATTR_PROPPUTREF */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" },
+ /* ATTR_PROXY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "proxy" },
+ /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "public" },
+ /* ATTR_RANGE */ { 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "range" },
+ /* ATTR_READONLY */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "readonly" },
+ /* ATTR_REPRESENTAS */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "represent_as" },
+ /* ATTR_REQUESTEDIT */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" },
+ /* ATTR_RESTRICTED */ { 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, "restricted" },
+ /* ATTR_RETVAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" },
+ /* ATTR_SIZEIS */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "size_is" },
+ /* ATTR_SOURCE */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "source" },
+ /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" },
+ /* ATTR_STRING */ { 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "string" },
+ /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "switch_is" },
+ /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, "switch_type" },
+ /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, "threading" },
+ /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" },
+ /* ATTR_UIDEFAULT */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
+ /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
+ /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" },
+ /* ATTR_UUID */ { 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, "uuid" },
+ /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
+ /* ATTR_VARARG */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
+ /* ATTR_VERSION */ { 1, 0, 0, 1, 0, 0, 1, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 1, "version" },
+ /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "vi_progid" },
+ /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
};
+static attr_list_t *append_attr(attr_list_t *list, attr_t *attr)
+{
+ attr_t *attr_existing;
+ if (!attr) return list;
+ if (!list)
+ {
+ list = xmalloc( sizeof(*list) );
+ list_init( list );
+ }
+ LIST_FOR_EACH_ENTRY(attr_existing, list, attr_t, entry)
+ if (attr_existing->type == attr->type && !allowed_attr[attr->type].multiple)
+ {
+ parser_warning("duplicate attribute %s\n", get_attr_display_name(attr->type));
+ /* use the last attribute, like MIDL does */
+ list_remove(&attr_existing->entry);
+ break;
+ }
+ list_add_tail( list, &attr->entry );
+ return list;
+}
+
const char *get_attr_display_name(enum attr_type type)
{
return allowed_attr[type].display_name;
--
2.28.0

View File

@ -1,7 +1,7 @@
From dfec9f64f5f1058ce394c8a39ae759ea027106a8 Mon Sep 17 00:00:00 2001
From 50bdc1b20819fb4dc4db3420726e7c2bc0c98193 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 12 Oct 2020 23:23:18 +0200
Subject: [PATCH 21/28] widl: Support partially specialized parameterized type.
Subject: [PATCH] widl: Support partially specialized parameterized type.
This allows parameterized types to reference each other with a different
set of parameters. This is required for instance for IIterable<T>, that
@ -39,10 +39,10 @@ index ab7c4753c3b..5f7a49c38e4 100644
contract(Windows.Foundation.FoundationContract, 1.0),
uuid(bbe1fa4c-b0e3-4583-baef-1f1b2e483e56)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index aa6ded5ba89..c9806ced633 100644
index 48135d4372e..14c9c5d007e 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -300,6 +300,8 @@ static typelib_t *current_typelib;
@@ -302,6 +302,8 @@ static typelib_t *current_typelib;
%type <type> type qualified_type
%type <type> type_parameter
%type <typelist> type_parameters
@ -51,7 +51,7 @@ index aa6ded5ba89..c9806ced633 100644
%type <typelist> requires required_types
%type <ifref> class_interface
%type <ifref_list> class_interfaces
@@ -908,6 +910,20 @@ qualified_type:
@@ -912,6 +914,20 @@ qualified_type:
| namespace_pfx aKNOWNTYPE { $$ = find_qualified_type_or_error($2, 0); }
;
@ -72,7 +72,7 @@ index aa6ded5ba89..c9806ced633 100644
coclass: tCOCLASS aIDENTIFIER { $$ = type_new_coclass($2); }
| tCOCLASS aKNOWNTYPE { $$ = find_type($2, NULL, 0);
if (type_get_type_detect_alias($$) != TYPE_COCLASS)
@@ -1000,6 +1016,7 @@ dispinterfacedef: dispinterfacehdr '{'
@@ -1004,6 +1020,7 @@ dispinterfacedef: dispinterfacehdr '{'
inherit: { $$ = NULL; }
| ':' qualified_type { $$ = $2; }
@ -80,7 +80,7 @@ index aa6ded5ba89..c9806ced633 100644
;
interface: tINTERFACE aIDENTIFIER { $$ = get_type(TYPE_INTERFACE, $2, current_namespace, 0); }
@@ -1026,6 +1043,7 @@ type_parameters:
@@ -1030,6 +1047,7 @@ type_parameters:
required_types:
qualified_type { $$ = append_type(NULL, $1); }
@ -88,7 +88,7 @@ index aa6ded5ba89..c9806ced633 100644
| required_types ',' required_types { $$ = append_types($1, $3); }
requires: { $$ = NULL; }
@@ -1247,6 +1265,7 @@ structdef: tSTRUCT t_ident '{' fields '}' { $$ = type_new_struct($2, current_nam
@@ -1251,6 +1269,7 @@ structdef: tSTRUCT t_ident '{' fields '}' { $$ = type_new_struct($2, current_nam
type: tVOID { $$ = type_new_void(); }
| qualified_type { $$ = $1; }
@ -96,7 +96,7 @@ index aa6ded5ba89..c9806ced633 100644
| base_type { $$ = $1; }
| enumdef { $$ = $1; }
| tENUM aIDENTIFIER { $$ = type_new_enum($2, current_namespace, FALSE, NULL); }
@@ -3324,3 +3343,19 @@ static void check_def(const type_t *t)
@@ -3367,3 +3386,19 @@ static void check_def(const type_t *t)
error_loc("%s: redefinition error; original definition was at %s:%d\n",
t->name, t->loc_info.input_name, t->loc_info.line_number);
}
@ -117,10 +117,10 @@ index aa6ded5ba89..c9806ced633 100644
+ return type;
+}
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index bbd519d98ab..9d50cabf172 100644
index 429e61e43d9..971ed8c1d0d 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -112,6 +112,22 @@ static int format_namespace_buffer(char *buf, size_t len, struct namespace *name
@@ -116,6 +116,22 @@ static int format_namespace_buffer(char *buf, size_t len, struct namespace *name
return ret;
}
@ -143,7 +143,7 @@ index bbd519d98ab..9d50cabf172 100644
#undef append_buf
char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix, const char *abi_prefix)
@@ -122,6 +138,14 @@ char *format_namespace(struct namespace *namespace, const char *prefix, const ch
@@ -126,6 +142,14 @@ char *format_namespace(struct namespace *namespace, const char *prefix, const ch
return buf;
}
@ -158,7 +158,7 @@ index bbd519d98ab..9d50cabf172 100644
type_t *type_new_function(var_list_t *args)
{
var_t *arg;
@@ -459,6 +483,14 @@ static unsigned int compute_method_indexes(type_t *iface)
@@ -463,6 +487,14 @@ static unsigned int compute_method_indexes(type_t *iface)
return idx;
}
@ -187,10 +187,10 @@ index b04a67f6b47..472fdf2d5fc 100644
void type_parameterized_interface_define(type_t *type, type_list_t *params, type_t *inherit, statement_list_t *stmts);
void type_interface_define(type_t *iface, type_t *inherit, statement_list_t *stmts, type_list_t *requires);
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index e2ffec6da8a..9863c4f72ff 100644
index 8dd6958ba35..ff71a1859ae 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -643,6 +643,7 @@ void init_loc_info(loc_info_t *);
@@ -651,6 +651,7 @@ void init_loc_info(loc_info_t *);
char *format_namespace(struct namespace *namespace, const char *prefix, const char *separator, const char *suffix,
const char *abi_prefix);
@ -199,5 +199,5 @@ index e2ffec6da8a..9863c4f72ff 100644
static inline enum type_type type_get_type_detect_alias(const type_t *type)
{
--
2.28.0
2.29.2

Some files were not shown because too many files have changed in this diff Show More