Files
liblogging/subprojects/packagefiles/quill/enable_pthread_header_emscripted.patch
Emily Boudreaux 888d44cec1 build(wasm): liblogging now builds for wasm
Further, due to limitations of file system access on wasm, liblogging now outputs all logs to the console syncronously
2025-12-03 10:46:29 -05:00

37 lines
1.2 KiB
Diff

--- quill/inlcude/quill/backend/BackendUtilities.h.orig 2025-12-03 10:02:26.861779737 -0500
+++ quill/include/quill/backend/BackendUtilities.h 2025-12-03 10:09:04.509482559 -0500
@@ -35,7 +35,7 @@
#elif defined(__CYGWIN__)
#include <sched.h>
#include <unistd.h>
-#elif defined(__linux__)
+#elif (defined(__linux__) || defined(__EMSCRIPTEN__))
#include <pthread.h>
#include <sched.h>
#include <unistd.h>
@@ -84,6 +84,8 @@
thread_port_t mach_thread = pthread_mach_thread_np(pthread_self());
thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, (thread_policy_t)&policy, 1);
+#elif defined(__EMSCRIPTEN__)
+ (void)cpu_id;
#else
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
@@ -102,7 +104,7 @@
/***/
QUILL_ATTRIBUTE_COLD inline void set_thread_name(char const* name)
{
-#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(QUILL_NO_THREAD_NAME_SUPPORT)
+#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(QUILL_NO_THREAD_NAME_SUPPORT) || defined(__EMSCRIPTEN__)
// Disabled on MINGW / Cygwin.
(void)name;
#elif defined(_WIN32)
@@ -154,4 +156,4 @@
}
} // namespace detail
-QUILL_END_NAMESPACE
\ No newline at end of file
+QUILL_END_NAMESPACE