SuperSlicer: fix build for beta5

This commit is contained in:
Gerasim Troeglazov
2025-03-08 11:55:48 +10:00
parent 8dece1cb63
commit 5ce4c24527
2 changed files with 59 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
From e2f32187454f65589c6a2503548c96a3ab719f31 Mon Sep 17 00:00:00 2001
From 9cc06c442e40499988b15302d00154b59760c3c3 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 8 Mar 2025 00:05:18 +1000
Subject: Fixes for Haiku
@@ -1272,3 +1272,60 @@ index 4db1acc..ac96361 100644
--
2.48.1
From 6b5ed8503f6d5d4bf761658279e912ed13e7db8c Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 8 Mar 2025 11:46:27 +1000
Subject: Implement set_thread_name for Haiku
diff --git a/src/libslic3r/Thread.cpp b/src/libslic3r/Thread.cpp
index 6f5efda..33bb3b5 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>
@@ -157,6 +161,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

View File

@@ -25,7 +25,7 @@ What are SuperSlicer main features? main new features/differences?
HOMEPAGE="https://github.com/supermerill/SuperSlicer"
COPYRIGHT="Merill"
LICENSE="GNU AGPL v3"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/supermerill/SuperSlicer/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="47ddf0dcf2d428e483011a74d32fe56a75fbe55dc8a3187956d5dd5758279dcb"
SOURCE_DIR="SuperSlicer-$portVersion"