Fix dethread build on OS X
authorPyry Haulos <phaulos@google.com>
Thu, 23 Apr 2015 18:34:58 +0000 (11:34 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 23 Apr 2015 18:34:58 +0000 (11:34 -0700)
On Darwin systems _SC_NPROCESSORS_CONF and _ONLN depend on
_DARWIN_C_FULL which is very cubersome to enable.

Change-Id: Ic78e861d9a46fd633e896461bf47901b7abf710f

framework/delibs/dethread/unix/deThreadUnix.c

index 4f46ddb..260ba45 100644 (file)
 #include <pthread.h>
 #include <sched.h>
 
+#if (DE_OS == DE_OS_OSX) || (DE_OS == DE_OS_IOS)
+#      if !defined(_SC_NPROCESSORS_CONF)
+#              define _SC_NPROCESSORS_CONF 57
+#      endif
+#      if !defined(_SC_NPROCESSORS_ONLN)
+#              define _SC_NPROCESSORS_ONLN 58
+#      endif
+#endif
+
 typedef struct Thread_s
 {
        pthread_t               thread;