OSDN Git Service

util/u_thread: fix compilation on Mac OS
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 10 Nov 2017 11:36:16 +0000 (12:36 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 10 Nov 2017 15:37:54 +0000 (16:37 +0100)
Apparently, it doesn't have pthread barriers.

p_config.h (which was originally used to guard this code) uses the
__APPLE__ macro to detect Mac OS.

Fixes: f0d3a4de75 ("util: move pipe_barrier into src/util and rename to util_barrier")
Cc: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/util/u_thread.h

index e484d8a..26cc0b0 100644 (file)
@@ -104,7 +104,7 @@ static inline bool u_thread_is_self(thrd_t thread)
  * util_barrier
  */
 
-#if defined(HAVE_PTHREAD)
+#if defined(HAVE_PTHREAD) && !defined(__APPLE__)
 
 typedef pthread_barrier_t util_barrier;