From f315e1f91321cc436d48a0a86886d2b16403e77b Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Mon, 22 Apr 2024 16:52:09 +0800 Subject: [PATCH] Do not use pthread_setname_np on < 10.6 --- ixwebsocket/IXSetThreadName.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ixwebsocket/IXSetThreadName.cpp b/ixwebsocket/IXSetThreadName.cpp index b1e77379..2f4ee75b 100644 --- a/ixwebsocket/IXSetThreadName.cpp +++ b/ixwebsocket/IXSetThreadName.cpp @@ -15,6 +15,10 @@ #include #endif +#ifdef __APPLE__ +#include +#endif + // Windows #ifdef _WIN32 #include @@ -58,7 +62,7 @@ namespace ix void setThreadName(const std::string& name) { -#if defined(__APPLE__) +#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) // // Apple reserves 16 bytes for its thread names // Notice that the Apple version of pthread_setname_np