From ef47e8b2127c45ee58cae6b6f8ace5d6fde695b2 Mon Sep 17 00:00:00 2001 From: Adam Stylinski Date: Sun, 11 Oct 2015 12:51:43 -0400 Subject: [PATCH] unix: make work with Solaris Studio. The atomics that are in place of a lack of x86 cmpxchg are a GCC specific intrinsic. When compiling for Solaris on a SPARC platform with a non-gcc compiler, this prevents a successful build. This commit will rely on a Solaris Studio specific preprocessor macro to redefine the GCC intrinsic name to be the Solaris Studio one instead. PR-URL: https://github.com/libuv/libuv/pull/569 Reviewed-By: Ben Noordhuis --- src/unix/atomic-ops.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/unix/atomic-ops.h b/src/unix/atomic-ops.h index 8fb157dc..84e47183 100644 --- a/src/unix/atomic-ops.h +++ b/src/unix/atomic-ops.h @@ -18,6 +18,11 @@ #include "internal.h" /* UV_UNUSED */ +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#include +#define __sync_val_compare_and_swap(p, o, n) atomic_cas_ptr(p, o, n) +#endif + UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)); UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)); UV_UNUSED(static void cpu_relax(void));