From fc3f9d69c4a99764af0885335c10e5286be351e9 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Wed, 27 Dec 2017 23:05:43 -0800
Subject: [PATCH 5/6] Threading: Only call pthread_setname_np() on SnowLeopard+

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
---
 lib/Support/Unix/Threading.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git llvm_master/lib/Support/Unix/Threading.inc macports_master/lib/Support/Unix/Threading.inc
index ed9a9656305..e8f9a13860f 100644
--- llvm_master/lib/Support/Unix/Threading.inc
+++ macports_master/lib/Support/Unix/Threading.inc
@@ -153,8 +154,10 @@ void llvm::set_thread_name(const Twine &Name) {
   ::pthread_setname_np(::pthread_self(), "%s",
     const_cast<char *>(NameStr.data()));
 #elif defined(__APPLE__)
+#if HAVE_PTHREAD_SETNAME_NP
   ::pthread_setname_np(NameStr.data());
 #endif
+#endif
 }
 
 void llvm::get_thread_name(SmallVectorImpl<char> &Name) {
-- 
2.21.0 (Apple Git-120)

