--- a/tools/clang/tools/libclang/CIndex.cpp.orig	2012-04-01 22:38:40.000000000 -0700
+++ b/tools/clang/tools/libclang/CIndex.cpp	2012-04-01 22:39:17.000000000 -0700
@@ -5754,7 +5754,7 @@ void SetSafetyThreadStackSize(unsigned V
 
 void clang::setThreadBackgroundPriority() {
   // FIXME: Move to llvm/Support and make it cross-platform.
-#ifdef __APPLE__
+#if defined(__APPLE__) && defined(PRIO_DARWIN_THREAD) && defined(PRIO_DARWIN_BG)
   setpriority(PRIO_DARWIN_THREAD, 0, PRIO_DARWIN_BG);
 #endif
 }
