From f62d034692bcffb355f42ee8b99530c6ebf2af81 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 11 Feb 2014 19:11:54 -0800 Subject: [PATCH] Fix clang compile error --- beast/Atomic.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beast/Atomic.h b/beast/Atomic.h index cd54d75ad0..97b271b8e3 100644 --- a/beast/Atomic.h +++ b/beast/Atomic.h @@ -207,6 +207,9 @@ private: #define BEAST_64BIT_ATOMICS_UNAVAILABLE 1 #endif +#elif BEAST_CLANG && BEAST_LINUX + #define BEAST_ATOMICS_GCC 1 + //============================================================================== #elif BEAST_GCC #define BEAST_ATOMICS_GCC 1 // GCC with intrinsics @@ -323,7 +326,7 @@ inline Type Atomic::operator++() noexcept return sizeof (Type) == 4 ? (Type) beast_InterlockedIncrement ((volatile long*) &value) : (Type) beast_InterlockedIncrement64 ((volatile __int64*) &value); #elif BEAST_ATOMICS_GCC - return (Type) __sync_add_and_fetch (&value, 1); + return (Type) __sync_add_and_fetch (&value, (Type) 1); #endif } @@ -337,7 +340,7 @@ inline Type Atomic::operator--() noexcept return sizeof (Type) == 4 ? (Type) beast_InterlockedDecrement ((volatile long*) &value) : (Type) beast_InterlockedDecrement64 ((volatile __int64*) &value); #elif BEAST_ATOMICS_GCC - return (Type) __sync_add_and_fetch (&value, -1); + return (Type) __sync_add_and_fetch (&value, (Type) -1); #endif }