OrcaSlicer: fix build for beta5

This commit is contained in:
Gerasim Troeglazov
2025-03-06 10:02:53 +10:00
parent ced8f8aa5d
commit 56eb6ab193
2 changed files with 60 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ Main features:
HOMEPAGE="https://github.com/SoftFever/OrcaSlicer"
COPYRIGHT="SoftFever"
LICENSE="GNU AGPL v3"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/SoftFever/OrcaSlicer/archive/refs/tags/v${portVersion/\~/-}.tar.gz"
CHECKSUM_SHA256="bee3bc54c968d8f7c069c00d4f196807b5522d77eb8424fd0c09f0a0e9666652"
SOURCE_DIR="OrcaSlicer-${portVersion/\~/-}"

View File

@@ -1,4 +1,4 @@
From 165ab3eb0ebc94eb18c114b3c6b929c1e379a762 Mon Sep 17 00:00:00 2001
From 08337722c8fddceb2237fd7f7e130dc9b8f2f285 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 3 Mar 2025 13:33:39 +1000
Subject: Fix for Haiku
@@ -1322,5 +1322,62 @@ index 4db1acc..3e0ab5a 100644
#endif
--
2.45.2
2.48.1
From bed5df72943e222d8a2a676d4c5cc392317d7d22 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 6 Mar 2025 09:59:29 +1000
Subject: Implement rename threads for Haiku
diff --git a/src/libslic3r/Thread.cpp b/src/libslic3r/Thread.cpp
index 3030b6d..11b2535 100644
--- a/src/libslic3r/Thread.cpp
+++ b/src/libslic3r/Thread.cpp
@@ -6,6 +6,10 @@
#include <pthread.h>
#endif
+#ifdef __HAIKU__
+#include <OS.h>
+#endif
+
#include <atomic>
#include <condition_variable>
#include <mutex>
@@ -156,6 +160,31 @@ std::optional<std::string> get_current_thread_name()
return std::nullopt;
}
+#elif defined(__HAIKU__)
+
+bool set_thread_name(std::thread &thread, const char *thread_name)
+{
+ return rename_thread(get_pthread_thread_id(thread.native_handle()), thread_name) == B_OK;
+}
+
+bool set_thread_name(boost::thread &thread, const char *thread_name)
+{
+ return rename_thread(get_pthread_thread_id(thread.native_handle()), thread_name) == B_OK;
+}
+
+bool set_current_thread_name(const char *thread_name)
+{
+ return rename_thread(find_thread(NULL), thread_name) == B_OK;
+}
+
+std::optional<std::string> get_current_thread_name()
+{
+ thread_info info;
+ if (get_thread_info(find_thread(NULL), &info) == B_OK)
+ return std::string(info.name);
+ return std::string("");
+}
+
#else
// posix
--
2.48.1