diff --git a/srcpkgs/PrusaSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch b/srcpkgs/PrusaSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch new file mode 100644 index 00000000000..8080380427b --- /dev/null +++ b/srcpkgs/PrusaSlicer/patches/0002-Replace-get_current_thread_name-for-musl.patch @@ -0,0 +1,30 @@ +--- src/libslic3r/Thread.cpp.orig 2021-01-24 13:50:00.469444149 +0100 ++++ src/libslic3r/Thread.cpp 2021-01-24 13:51:17.109443201 +0100 +@@ -171,16 +171,27 @@ bool set_thread_name(boost::thread &thre + return true; + } + ++#ifndef __GLIBC__ ++thread_local char current_thread_name[16] = { 0 }; ++#endif ++ + bool set_current_thread_name(const char *thread_name) + { ++#ifndef __GLIBC__ ++ strncpy(current_thread_name, thread_name, 15); ++#endif + pthread_setname_np(pthread_self(), thread_name); + return true; + } + + std::optional get_current_thread_name() + { ++#ifdef __GLIBC__ + char buf[16]; + return std::string(pthread_getname_np(pthread_self(), buf, 16) == 0 ? buf : ""); ++#else ++ return std::string(current_thread_name); ++#endif + } + + #endif