Rebase against 4de079bb7247c8b849558c0f27a280a9546c5570.

This commit is contained in:
Zebediah Figura 2021-02-19 19:32:08 -06:00
parent aa8a3d90cb
commit 9aeea5d12e
9 changed files with 59 additions and 254 deletions

View File

@ -1,4 +1,4 @@
From 73b91ff2ff705bf35d9603a6446b424af90fb199 Mon Sep 17 00:00:00 2001
From 79b9dda91ac0e33add2252f9ad5c10ba752ddabb Mon Sep 17 00:00:00 2001
From: Lucian Poston <lucianposton@pm.me>
Date: Wed, 23 May 2018 00:01:42 -0700
Subject: [PATCH] dwrite: Test GetMetrics with custom fontcollection
@ -9,10 +9,10 @@ Signed-off-by: Lucian Poston <lucianposton@pm.me>
1 file changed, 279 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c
index 4cba57764fd..26f4693e862 100644
index 9a450495146..9f1051b4905 100644
--- a/dlls/dwrite/tests/layout.c
+++ b/dlls/dwrite/tests/layout.c
@@ -3339,7 +3339,7 @@ todo_wine
@@ -3363,7 +3363,7 @@ todo_wine
DWRITE_FONT_STRETCH_NORMAL, 10.0, L"en-us", &format);
ok(hr == S_OK, "got 0x%08x\n", hr);
@ -21,7 +21,7 @@ index 4cba57764fd..26f4693e862 100644
ok(hr == S_OK, "got 0x%08x\n", hr);
count = 0;
@@ -4522,6 +4522,7 @@ static void test_SetWordWrapping(void)
@@ -4546,6 +4546,7 @@ static void test_SetWordWrapping(void)
/* Collection dedicated to fallback testing */
static const WCHAR g_blahfontW[] = {'B','l','a','h',0};
@ -29,7 +29,7 @@ index 4cba57764fd..26f4693e862 100644
static HRESULT WINAPI fontcollection_QI(IDWriteFontCollection *iface, REFIID riid, void **obj)
{
if (IsEqualIID(riid, &IID_IDWriteFontCollection) || IsEqualIID(riid, &IID_IUnknown)) {
@@ -4583,6 +4584,9 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
@@ -4607,6 +4608,9 @@ static HRESULT WINAPI fontcollection_FindFamilyName(IDWriteFontCollection *iface
*index = 123456;
*exists = TRUE;
return S_OK;
@ -39,8 +39,8 @@ index 4cba57764fd..26f4693e862 100644
}
ok(0, "unexpected call, name %s\n", wine_dbgstr_w(name));
return E_NOTIMPL;
@@ -5992,6 +5996,279 @@ if (SUCCEEDED(hr))
IDWriteFactory6_Release(factory);
@@ -6405,6 +6409,279 @@ static void test_layout_range_length(void)
IDWriteFactory_Release(factory);
}
+static void test_GetMetrics_with_custom_fontcollection(void)
@ -319,7 +319,7 @@ index 4cba57764fd..26f4693e862 100644
START_TEST(layout)
{
IDWriteFactory *factory;
@@ -6025,6 +6302,7 @@ START_TEST(layout)
@@ -6438,6 +6715,7 @@ START_TEST(layout)
test_SetFontStretch();
test_SetStrikethrough();
test_GetMetrics();
@ -328,5 +328,5 @@ index 4cba57764fd..26f4693e862 100644
test_SetDrawingEffect();
test_GetLineMetrics();
--
2.29.2
2.20.1

View File

@ -1,4 +1,4 @@
From b528c37ea124f6c84bf2383a75ae50dc6f12b571 Mon Sep 17 00:00:00 2001
From 19ec5223ae49b6862ca6fc420a2c41f94befc0df Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 12:09:22 -0500
Subject: [PATCH] ntdll: Create eventfd-based objects for semaphores.
@ -16,7 +16,7 @@ Subject: [PATCH] ntdll: Create eventfd-based objects for semaphores.
create mode 100644 dlls/ntdll/unix/esync.h
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index 258274ac529..1c3fb065ecf 100644
index b2f63d9f63a..5dc4ebb07fc 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -46,6 +46,7 @@ C_SRCS = \
@ -348,7 +348,7 @@ index 00000000000..a50a755149a
+
+extern int receive_fd( obj_handle_t *handle ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index bcd1635e75c..52e61feb43a 100644
index c4f897f3d0d..0012d8d08af 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -89,6 +89,7 @@
@ -359,16 +359,16 @@ index bcd1635e75c..52e61feb43a 100644
#include "wine/list.h"
#include "wine/debug.h"
@@ -1626,6 +1627,7 @@ static void start_main_thread(void)
@@ -1649,6 +1650,7 @@ static void start_main_thread(void)
signal_init_thread( teb );
dbg_init();
startup_info_size = server_init_process();
+ esync_init();
virtual_map_user_shared_data();
init_cpu_info();
init_files();
syscall_dispatcher = signal_init_syscalls();
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index 7b469959f66..3063a13efb5 100644
index 6af8effe9e1..401d439b363 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -112,7 +112,7 @@ timeout_t server_start_time = 0; /* time of server startup */
@ -390,7 +390,7 @@ index 7b469959f66..3063a13efb5 100644
struct iovec vec;
struct msghdr msghdr;
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index 383e9c93273..19e1494a9b8 100644
index 16635ee42fa..2c795ea5ee8 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -72,6 +72,7 @@
@ -412,7 +412,7 @@ index 383e9c93273..19e1494a9b8 100644
{
req->access = access;
diff --git a/server/esync.c b/server/esync.c
index b8b257281bf..226e70cd1ad 100644
index a571855c70a..e41bbbf9349 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -43,6 +43,7 @@
@ -424,5 +424,5 @@ index b8b257281bf..226e70cd1ad 100644
int do_esync(void)
{
--
2.29.2
2.20.1

View File

@ -1,4 +1,4 @@
From 32242051c19fcd4f4f0ada534ad5a1621df96b45 Mon Sep 17 00:00:00 2001
From 8d1cfce5ceee03b91f9843e7b5123fed823687e7 Mon Sep 17 00:00:00 2001
From: Paul Gofman <pgofman@codeweavers.com>
Date: Tue, 14 Jul 2020 15:00:34 +0300
Subject: [PATCH] ntdll: Support x86_64 syscall emulation.
@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Support x86_64 syscall emulation.
3 files changed, 120 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5e392ff5ed6..d814b6f85d7 100644
index caff5d1fe52..d30b437320a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -466,6 +466,7 @@ AC_CHECK_HEADERS(\
@@ -467,6 +467,7 @@ AC_CHECK_HEADERS(\
linux/joystick.h \
linux/major.h \
linux/param.h \
@ -22,7 +22,7 @@ index 5e392ff5ed6..d814b6f85d7 100644
linux/types.h \
linux/ucdrom.h \
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 892d208e43a..bb820eee6e5 100644
index 8d3353e959d..a8a142c2ab1 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -28,6 +28,7 @@
@ -33,7 +33,7 @@ index 892d208e43a..bb820eee6e5 100644
#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
@@ -64,6 +65,13 @@
@@ -65,6 +66,13 @@
# include <mach/mach.h>
#endif
@ -47,7 +47,7 @@ index 892d208e43a..bb820eee6e5 100644
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
@@ -2320,6 +2328,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
@@ -2292,6 +2300,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
return 0;
}
@ -162,7 +162,7 @@ index 892d208e43a..bb820eee6e5 100644
/***********************************************************************
* handle_interrupt
@@ -2779,6 +2895,7 @@ void signal_init_process(void)
@@ -2751,6 +2867,7 @@ void signal_init_process(void)
if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error;
if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error;
if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error;
@ -171,18 +171,18 @@ index 892d208e43a..bb820eee6e5 100644
error:
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 5645d3aa9af..441a3800726 100644
index 0fddbaf6134..901423cc028 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1526,6 +1526,7 @@ void output_syscalls( DLLSPEC *spec )
/* Legends of Runeterra hooks the first system call return instruction, and
* depends on us returning to it. Adjust the return address accordingly. */
output( "\tsubq $0xb,0x8(%%rbp)\n" );
+ output( "\tsubq $0xf000,%%rax\n" );
output( "\tmovq 0x8(%%rbp),%%rbx\n" );
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
@@ -1746,7 +1747,7 @@ void output_syscalls( DLLSPEC *spec )
@@ -1510,6 +1510,7 @@ static void output_syscall_dispatcher( int count, const char *variant )
/* Legends of Runeterra hooks the first system call return instruction, and
* depends on us returning to it. Adjust the return address accordingly. */
output( "\tsubq $0xb,0x8(%%rbp)\n" );
+ output( "\tsubq $0xf000,%%rax\n" );
output( "\tmovq 0x8(%%rbp),%%rbx\n" );
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
@@ -1779,7 +1780,7 @@ void output_syscalls( DLLSPEC *spec )
* validate that instruction, we can just put a jmp there instead. */
output( "\t.byte 0x4c,0x8b,0xd1\n" ); /* movq %rcx,%r10 */
output( "\t.byte 0xb8\n" ); /* movl $i,%eax */

View File

@ -1,4 +1,4 @@
From a65d5445eea1a5aa1108d5b214a37b37a8c82888 Mon Sep 17 00:00:00 2001
From 0cdc9966b9cf95ab1d2c53112ef6ea03479a5708 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 4 Oct 2014 02:53:22 +0200
Subject: [PATCH] ntdll: Setup a temporary signal handler during process
@ -15,10 +15,10 @@ Subject: [PATCH] ntdll: Setup a temporary signal handler during process
7 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 6890a08428b..557d7254190 100644
index c4f897f3d0d..7eedb03e7a0 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -1775,6 +1775,8 @@ void __wine_main( int argc, char *argv[], char *envp[] )
@@ -1983,6 +1983,8 @@ void __wine_main( int argc, char *argv[], char *envp[] )
#endif
virtual_init();
@ -28,11 +28,11 @@ index 6890a08428b..557d7254190 100644
#ifdef __APPLE__
diff --git a/dlls/ntdll/unix/signal_arm.c b/dlls/ntdll/unix/signal_arm.c
index e8971d22dbd..ca291456284 100644
index 2de58925c84..3816f4429b8 100644
--- a/dlls/ntdll/unix/signal_arm.c
+++ b/dlls/ntdll/unix/signal_arm.c
@@ -977,6 +977,12 @@ void signal_init_process(void)
exit(1);
@@ -971,6 +971,12 @@ void *signal_init_syscalls(void)
return __wine_syscall_dispatcher;
}
+/**********************************************************************
@ -45,13 +45,13 @@ index e8971d22dbd..ca291456284 100644
/***********************************************************************
* init_thread_context
diff --git a/dlls/ntdll/unix/signal_arm64.c b/dlls/ntdll/unix/signal_arm64.c
index e08d6a2ee17..025fa63316a 100644
index 9a36746f5bc..b04eaf92b65 100644
--- a/dlls/ntdll/unix/signal_arm64.c
+++ b/dlls/ntdll/unix/signal_arm64.c
@@ -1070,6 +1070,13 @@ void signal_init_process(void)
exit(1);
@@ -1130,6 +1130,13 @@ void *signal_init_syscalls(void)
}
+/**********************************************************************
+ * signal_init_early
+ */
@ -63,10 +63,10 @@ index e08d6a2ee17..025fa63316a 100644
* init_thread_context
*/
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c
index e0ba27d3e94..dd9c8e255cc 100644
index 09529a1ea96..41ea96ccbff 100644
--- a/dlls/ntdll/unix/signal_i386.c
+++ b/dlls/ntdll/unix/signal_i386.c
@@ -1865,6 +1865,30 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr,
@@ -1907,6 +1907,30 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, void *stack_ptr,
}
@ -97,8 +97,8 @@ index e0ba27d3e94..dd9c8e255cc 100644
/**********************************************************************
* segv_handler
*
@@ -2424,6 +2448,34 @@ void signal_init_process(void)
exit(1);
@@ -2475,6 +2499,34 @@ void *signal_init_syscalls(void)
return __wine_syscall_dispatcher;
}
+/**********************************************************************
@ -133,11 +133,11 @@ index e0ba27d3e94..dd9c8e255cc 100644
/***********************************************************************
* init_thread_context
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index e11b2c70b59..1b45ca246d3 100644
index 8d3353e959d..7c0b446ecba 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -2680,6 +2680,12 @@ void signal_init_process(void)
exit(1);
@@ -2783,6 +2783,12 @@ void *signal_init_syscalls(void)
return syscall_dispatcher;
}
+/**********************************************************************
@ -150,22 +150,22 @@ index e11b2c70b59..1b45ca246d3 100644
/***********************************************************************
* init_thread_context
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index f99c13fe2ad..26f251b889a 100644
index 65f526d0f7d..ca18cede199 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -210,6 +210,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN;
@@ -208,6 +208,7 @@ extern NTSTATUS signal_alloc_thread( TEB *teb ) DECLSPEC_HIDDEN;
extern void signal_free_thread( TEB *teb ) DECLSPEC_HIDDEN;
extern void signal_init_thread( TEB *teb ) DECLSPEC_HIDDEN;
extern void signal_init_process(void) DECLSPEC_HIDDEN;
+extern void signal_init_early(void) DECLSPEC_HIDDEN;
extern void *signal_init_syscalls(void) DECLSPEC_HIDDEN;
extern void DECLSPEC_NORETURN signal_start_thread( PRTL_THREAD_START_ROUTINE entry, void *arg,
BOOL suspend, void *thunk, TEB *teb ) DECLSPEC_HIDDEN;
extern void DECLSPEC_NORETURN signal_exit_thread( int status, void (*func)(int) ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index f18e75c0842..0649b30e8b3 100644
index 9889028de27..6cdf5c3fa5c 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -2917,7 +2917,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
@@ -2933,7 +2933,7 @@ NTSTATUS virtual_handle_fault( void *addr, DWORD err, void *stack )
mutex_lock( &virtual_mutex ); /* no need for signal masking inside signal handler */
vprot = get_page_vprot( page );
@ -175,5 +175,5 @@ index f18e75c0842..0649b30e8b3 100644
if (page < (char *)NtCurrentTeb()->DeallocationStack ||
page >= (char *)NtCurrentTeb()->Tib.StackBase)
--
2.28.0
2.20.1

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "b8719736c5a022fa9c50f64adfc3ef58b40460f2"
echo "4de079bb7247c8b849558c0f27a280a9546c5570"
}
# Show version information

View File

@ -1,29 +0,0 @@
From f3fb964cf3cf78efb9242cc0ca281c2a16bec089 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Thu, 7 Jan 2021 13:07:33 +0100
Subject: [PATCH] widl: Never use the namespace ABI prefix for global types.
Otherwise we end up with types like ABI::IInspectable.
---
tools/widl/typetree.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index 65bc24edb0f..bd7ae2e4463 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -106,9 +106,10 @@ static size_t append_namespace(char **buf, size_t *len, size_t pos, struct names
static size_t append_namespaces(char **buf, size_t *len, size_t pos, struct namespace *namespace, const char *prefix,
const char *separator, const char *suffix, const char *abi_prefix)
{
+ int nested = namespace && !is_global_namespace(namespace);
size_t n = 0;
n += strappend(buf, len, pos + n, "%s", prefix);
- n += append_namespace(buf, len, pos + n, namespace, separator, abi_prefix);
+ if (nested) n += append_namespace(buf, len, pos + n, namespace, separator, abi_prefix);
n += strappend(buf, len, pos + n, "%s", suffix);
return n;
}
--
2.20.1

View File

@ -1,140 +0,0 @@
From 6253706be0eef579fd9f68530ce646575e42a2e3 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Thu, 7 Jan 2021 14:28:21 +0100
Subject: [PATCH] widl: Precompute qualified type names, and use them for C++
interfaces.
This is what MIDL does and avoid mismatching and even fixes some compiling issues.
---
tools/widl/header.c | 8 +++-----
tools/widl/parser.y | 6 ++++++
tools/widl/typetree.c | 16 ++++++++++++++++
tools/widl/typetree.h | 1 +
tools/widl/widltypes.h | 1 +
5 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index a8141d5f61d..d327c621ad8 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -137,15 +137,13 @@ static void write_guid(FILE *f, const char *guid_prefix, const char *name, const
static void write_uuid_decl(FILE *f, type_t *type, const UUID *uuid)
{
- char *name = format_namespace(type->namespace, "", "::", type->name, use_abi_namespace ? "ABI" : NULL);
fprintf(f, "#ifdef __CRT_UUID_DECL\n");
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",
- name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], uuid->Data4[1],
+ type->qualified_name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], uuid->Data4[1],
uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], uuid->Data4[6],
uuid->Data4[7]);
fprintf(f, "#endif\n");
- free(name);
}
static const char *uuid_string(const UUID *uuid)
@@ -467,13 +465,13 @@ void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, i
case TYPE_INTERFACE:
case TYPE_MODULE:
case TYPE_COCLASS:
- fprintf(h, "%s", name);
+ fprintf(h, "%s", type_get_qualified_name(t, name_type));
break;
case TYPE_RUNTIMECLASS:
fprintf(h, "%s", type_get_name(type_runtimeclass_get_default_iface(t), name_type));
break;
case TYPE_DELEGATE:
- fprintf(h, "%s", type_get_name(type_delegate_get_iface(t), name_type));
+ fprintf(h, "%s", type_get_qualified_name(type_delegate_get_iface(t), name_type));
break;
case TYPE_VOID:
fprintf(h, "void");
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index d8ab4a24ced..bd6f5c7e37f 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2089,9 +2089,15 @@ type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, in
nt = xmalloc(sizeof(struct rtype));
nt->name = name;
if (is_global_namespace(namespace))
+ {
type->c_name = name;
+ type->qualified_name = name;
+ }
else
+ {
type->c_name = format_namespace(namespace, "__x_", "_C", name, use_abi_namespace ? "ABI" : NULL);
+ type->qualified_name = format_namespace(namespace, "", "::", name, use_abi_namespace ? "ABI" : NULL);
+ }
nt->type = type;
nt->t = t;
nt->next = namespace->type_hash[hash];
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index bd7ae2e4463..fc8da22c730 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -52,6 +52,7 @@ type_t *make_type(enum type_type type)
t->c_name = NULL;
t->signature = NULL;
t->short_name = NULL;
+ t->qualified_name = NULL;
memset(&t->details, 0, sizeof(t->details));
t->typestring_offset = 0;
t->ptrdesc = 0;
@@ -92,6 +93,20 @@ const char *type_get_name(const type_t *type, enum name_type name_type)
return NULL;
}
+const char *type_get_qualified_name(const type_t *type, enum name_type name_type)
+{
+ assert(!!type->c_name == !!type->qualified_name);
+ switch(name_type) {
+ case NAME_DEFAULT:
+ return type->qualified_name;
+ case NAME_C:
+ return type->c_name;
+ }
+
+ assert(0);
+ return NULL;
+}
+
static size_t append_namespace(char **buf, size_t *len, size_t pos, struct namespace *namespace, const char *separator, const char *abi_prefix)
{
int nested = namespace && !is_global_namespace(namespace);
@@ -815,6 +830,7 @@ static void compute_delegate_iface_names(type_t *delegate, type_t *type, type_li
iface->name = strmake("I%s", delegate->name);
if (type) iface->c_name = format_parameterized_type_c_name(type, params, "I");
else iface->c_name = format_namespace(delegate->namespace, "__x_", "_C", iface->name, use_abi_namespace ? "ABI" : NULL);
+ iface->qualified_name = format_namespace(delegate->namespace, "", "::", iface->name, use_abi_namespace ? "ABI" : NULL);
}
type_t *type_delegate_declare(char *name, struct namespace *namespace)
diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h
index db43a9aa456..b72147af5c7 100644
--- a/tools/widl/typetree.h
+++ b/tools/widl/typetree.h
@@ -75,6 +75,7 @@ type_t *type_parameterized_type_specialize_declare(type_t *type, type_list_t *pa
type_t *type_parameterized_type_specialize_define(type_t *type, type_list_t *params);
int type_is_equal(const type_t *type1, const type_t *type2);
const char *type_get_name(const type_t *type, enum name_type name_type);
+const char *type_get_qualified_name(const type_t *type, enum name_type name_type);
char *gen_name(void);
extern int is_attr(const attr_list_t *list, enum attr_type t);
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 21598a9213d..6aeeac228b6 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -505,6 +505,7 @@ struct _type_t {
const char *c_name;
const char *signature;
const char *short_name;
+ const char *qualified_name;
unsigned int typestring_offset;
unsigned int ptrdesc; /* used for complex structs */
int typelib_idx;
--
2.20.1

View File

@ -1,26 +0,0 @@
From 248bbf6533e66975d4971a5cc72ae9e8d2091210 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Thu, 7 Jan 2021 14:14:22 +0100
Subject: [PATCH] widl: Define the C type name as an alias for the C++
qualified name.
---
tools/widl/header.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/widl/header.c b/tools/widl/header.c
index d327c621ad8..1bf527c642d 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -1483,6 +1483,8 @@ static void write_forward(FILE *header, type_t *iface)
fprintf(header, "#define __%s_FWD_DEFINED__\n", iface->c_name);
fprintf(header, "typedef interface %s %s;\n", iface->c_name, iface->c_name);
fprintf(header, "#ifdef __cplusplus\n");
+ if (iface->namespace && !is_global_namespace(iface->namespace))
+ fprintf(header, "#define %s %s\n", iface->c_name, iface->qualified_name);
write_namespace_start(header, iface->namespace);
if (strchr(iface->name, '<')) write_line(header, 0, "template<> struct %s;", iface->name);
else write_line(header, 0, "interface %s;", iface->name);
--
2.20.1

View File

@ -1 +1 @@
b8719736c5a022fa9c50f64adfc3ef58b40460f2
4de079bb7247c8b849558c0f27a280a9546c5570