openbsd-ports/lang/hashlink/patches/patch-src_std_thread_c
thfr d91372f3ae Update to checkout from 2023-01-03. This way version 3 of Northgard can run.
Also tested with other major hashlink games without issues: Dead Cells,
Nuclear Blaze, Evoland Legendary Edition.

Northgard DLC Cross of Vidar needs hlvideo (video.hdll library) before this
can be run.
2023-01-04 20:40:47 +00:00

25 lines
748 B
Plaintext

enable hl_thread_id for OpenBSD using getthrid(2)
pthread_setname_np -> pthread_set_name_np
Index: src/std/thread.c
--- src/std/thread.c.orig
+++ src/std/thread.c
@@ -809,6 +809,8 @@ HL_PRIM int hl_thread_id() {
uint64_t tid64;
pthread_threadid_np(NULL, &tid64);
return (pid_t)tid64;
+#elif defined(__OpenBSD__)
+ return getthrid();
#elif defined(SYS_gettid) && !defined(HL_TVOS)
return syscall(SYS_gettid);
#else
@@ -940,7 +942,7 @@ HL_PRIM void hl_thread_set_name( hl_thread *t, const c
#elif defined(HL_MAC)
// pthread_setname_np only possible for current thread
#else
- pthread_setname_np((pthread_t)t,name);
+ pthread_set_name_np((pthread_t)t,name);
#endif
#ifdef HL_THREADS
hl_threads_info *threads = hl_gc_threads_info();