From e6f64b0058a576c78f7ad4dee747c269b0444006 Mon Sep 17 00:00:00 2001
From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Date: Thu, 4 Jul 2019 13:23:19 -0700
Subject: [PATCH 6/6] Only call setpriority(PRIO_DARWIN_THREAD, 0,
 PRIO_DARWIN_BG) if it is available

Tiger and earlier versions of darwin do not support this.

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

diff --git llvm_master/lib/Support/Unix/Threading.inc macports_master/lib/Support/Unix/Threading.inc
index e8f9a13860f..e731f750c1d 100644
--- llvm_master/lib/Support/Unix/Threading.inc
+++ macports_master/lib/Support/Unix/Threading.inc
@@ -237,7 +237,7 @@ SetThreadPriorityResult llvm::set_thread_priority(ThreadPriority Priority) {
              &priority)
              ? SetThreadPriorityResult::SUCCESS
              : SetThreadPriorityResult::FAILURE;
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && defined(PRIO_DARWIN_THREAD) && defined(PRIO_DARWIN_BG)
   // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getpriority.2.html
   // When setting a thread into background state the scheduling priority is set
   // to lowest value, disk and network IO are throttled. Network IO will be
-- 
2.21.0 (Apple Git-120)

