Fix clang compile error

This commit is contained in:
Nicholas Dudfield
2014-02-11 19:11:54 -08:00
committed by Vinnie Falco
parent deb180cc83
commit f62d034692

View File

@@ -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<Type>::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<Type>::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
}