libreoffice-online/wasm/poco-devel-emscripten.patch
Michael Stahl e53ea70799 WASM document how to build dependencies in wasm/README
Signed-off-by: Michael Stahl <michael.stahl@allotropia.de>
Change-Id: I88977976be9212088f7a758940852719931b4263
2023-01-09 15:21:37 +02:00

32 lines
1.1 KiB
Diff

diff --git a/Foundation/src/Thread_POSIX.cpp b/Foundation/src/Thread_POSIX.cpp
index 4235ab2f4..e879df804 100644
--- a/Foundation/src/Thread_POSIX.cpp
+++ b/Foundation/src/Thread_POSIX.cpp
@@ -72,7 +72,7 @@ namespace
{
#if (POCO_OS == POCO_OS_MAC_OS_X)
if (pthread_setname_np(threadName.c_str()))
-#else
+#elif !defined(__EMSCRIPTEN__)
if (pthread_setname_np(pthread_self(), threadName.c_str()))
#endif
throw Poco::SystemException("cannot get thread name");
@@ -81,7 +81,9 @@ namespace
std::string getThreadName()
{
char name[POCO_MAX_THREAD_NAME_LEN + 1]{'\0'};
+#if !defined(__EMSCRIPTEN__)
if (pthread_getname_np(pthread_self(), name, POCO_MAX_THREAD_NAME_LEN + 1))
+#endif
throw Poco::SystemException("cannot get thread name");
return name;
}
@@ -318,7 +320,7 @@ ThreadImpl::TIDImpl ThreadImpl::currentTidImpl()
long ThreadImpl::currentOsTidImpl()
{
-#if POCO_OS == POCO_OS_LINUX
+#if POCO_OS == POCO_OS_LINUX && !defined(__EMSCRIPTEN__)
return ::syscall(SYS_gettid);
#elif POCO_OS == POCO_OS_MAC_OS_X
return ::pthread_mach_thread_np(::pthread_self());