vcpkg/ports/pthreads/fix-uwp-linkage.patch
tdcosta100 b7eaf99a7b
[pthreads] Fix EACCESSVIOLATION in pthread_getname_np and better install handling (#28173)
* [pthreads] Fix EACCESSVIOLATION in pthread_getname_np

* [pthreads] Use vcpkg options instead custom commands

* [pthreads] Update port version

* [pthreads] Don't use separate builds for release and debug

* [pthreads] Update port version

* [pthreads] Cleaner solution for building configuration

* [pthreads] Update port version

* [pthreads] Correct variable name

* [pthreads] Update port version

* [pthreads] Make install even more optimized

* [pthreads] Update port version

* [pthreads] Fix static builds

* [pthreads] Update port version

* [pthreads] Correct quotes

* [pthreads] Update port version

* [pthreads] Fix compatibility with UWP

* [pthreads] Update port version

* [pthreads] Correction in fix-pthread_getname_np.patch

* [pthreads] Update port version
2022-12-28 14:04:12 -08:00

38 lines
1.1 KiB
Diff

diff --git a/implement.h b/implement.h
index 1579376..3a7d29b 100644
--- a/implement.h
+++ b/implement.h
@@ -36,6 +36,12 @@
#if !defined(_IMPLEMENT_H)
#define _IMPLEMENT_H
+#if 1 // The condition should be `defined(__cplusplus_winrt)` when compile option is provided correctly.
+// porvide 2 static libs to resolve link error. 'kernel32' and 'windowsapp'
+#pragma comment(lib, "kernel32")
+#pragma comment(lib, "WindowsApp")
+#endif
+
#if !defined (__PTW32_CONFIG_H)
# error "config.h was not #included"
#endif
diff --git a/pthread_cancel.c b/pthread_cancel.c
index fddf216..bf16870 100644
--- a/pthread_cancel.c
+++ b/pthread_cancel.c
@@ -64,12 +64,12 @@ __ptw32_cancel_callback (ULONG_PTR unused)
DWORD
__ptw32_Registercancellation (PAPCFUNC unused1, HANDLE threadH, DWORD unused2)
{
- CONTEXT context;
+ /*CONTEXT context;
context.ContextFlags = CONTEXT_CONTROL;
GetThreadContext (threadH, &context);
__PTW32_PROGCTR (context) = (DWORD_PTR) __ptw32_cancel_self;
- SetThreadContext (threadH, &context);
+ SetThreadContext (threadH, &context);*/
return 0;
}