Mac OS only gained pthread_setname_np in 10.6...

...and our build servers apparently run 10.5!

Change-Id: I69c2f2212e616d83c043bb24e683b5437bceea54
diff --git a/src/utils.cc b/src/utils.cc
index cf3e6c3..4895fe5 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -38,6 +38,10 @@
 #include <sys/prctl.h>
 #endif
 
+#if defined(__APPLE__)
+#include "AvailabilityMacros.h"
+#endif
+
 #if defined(__linux__)
 #include <linux/unistd.h>
 #endif
@@ -714,7 +718,7 @@
   if (errno != 0) {
     PLOG(WARNING) << "Unable to set the name of current thread to '" << buf << "'";
   }
-#elif defined(__APPLE__)
+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
   pthread_setname_np(threadName);
 #elif defined(HAVE_PRCTL)
   prctl(PR_SET_NAME, (unsigned long) s, 0, 0, 0);