Mostly fixing up alloy clang build.
This commit is contained in:
@@ -40,10 +40,12 @@ inline int64_t atomic_exchange(int64_t new_value, volatile int64_t* value) {
|
||||
return OSAtomicCompareAndSwap64Barrier(*value, new_value, value);
|
||||
}
|
||||
|
||||
//inline int32_t atomic_exchange_add(int32_t amount, volatile int32_t* value) {
|
||||
//}
|
||||
//inline int64_t atomic_exchange_add(int64_t amount, volatile int64_t* value) {
|
||||
//}
|
||||
inline int32_t atomic_exchange_add(int32_t amount, volatile int32_t* value) {
|
||||
return OSAtomicAdd32Barrier(amount, value) - amount;
|
||||
}
|
||||
inline int64_t atomic_exchange_add(int64_t amount, volatile int64_t* value) {
|
||||
return OSAtomicAdd64Barrier(amount, value) - amount;
|
||||
}
|
||||
|
||||
inline bool atomic_cas(int32_t old_value, int32_t new_value,
|
||||
volatile int32_t* value) {
|
||||
@@ -51,7 +53,7 @@ inline bool atomic_cas(int32_t old_value, int32_t new_value,
|
||||
old_value, new_value, reinterpret_cast<volatile int32_t*>(value));
|
||||
}
|
||||
inline bool atomic_cas(int64_t old_value, int64_t new_value,
|
||||
volatile int32_t* value) {
|
||||
volatile int64_t* value) {
|
||||
return OSAtomicCompareAndSwap64Barrier(
|
||||
old_value, new_value, reinterpret_cast<volatile int64_t*>(value));
|
||||
}
|
||||
@@ -110,10 +112,12 @@ inline int64_t atomic_exchange(int64_t new_value, volatile int64_t* value) {
|
||||
return __sync_val_compare_and_swap(*value, value, new_value);
|
||||
}
|
||||
|
||||
//inline int32_t atomic_exchange_add(int32_t amount, volatile int32_t* value) {
|
||||
//}
|
||||
//inline int64_t atomic_exchange_add(int64_t amount, volatile int64_t* value) {
|
||||
//}
|
||||
inline int32_t atomic_exchange_add(int32_t amount, volatile int32_t* value) {
|
||||
return __sync_fetch_and_add(amount, value);
|
||||
}
|
||||
inline int64_t atomic_exchange_add(int64_t amount, volatile int64_t* value) {
|
||||
return __sync_fetch_and_add(amount, value);
|
||||
}
|
||||
|
||||
inline bool atomic_cas(int32_t old_value, int32_t new_value,
|
||||
volatile int32_t* value) {
|
||||
|
||||
Reference in New Issue
Block a user