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 }