[wasm] Fix build failure on Ubuntu with gcc 5.4.0
gcc 5.4.0 doesn't support atomic_##type Bug: Change-Id: I31d112097b6236299caf86bfc7a34888cbe65e39 Reviewed-on: https://chromium-review.googlesource.com/757178 Reviewed-by: Deepti Gandluri <gdeepti@chromium.org> Commit-Queue: Junliang Yan <jyan@ca.ibm.com> Cr-Commit-Position: refs/heads/master@{#49205}
This commit is contained in:
parent
2f550ff39d
commit
0be828dc00
@ -1556,18 +1556,19 @@ class ThreadImpl {
|
||||
break; \
|
||||
}
|
||||
#else
|
||||
#define ATOMIC_BINOP_CASE(name, type, operation) \
|
||||
case kExpr##name: { \
|
||||
type val; \
|
||||
Address addr; \
|
||||
if (!ExtractAtomicBinOpParams<type>(decoder, code, addr, pc, val, len)) { \
|
||||
return false; \
|
||||
} \
|
||||
static_assert(sizeof(std::atomic_##type) == sizeof(type), \
|
||||
"Size mismatch for types std::atomic_##type, and type"); \
|
||||
result = WasmValue( \
|
||||
std::operation(reinterpret_cast<std::atomic_##type*>(addr), val)); \
|
||||
break; \
|
||||
#define ATOMIC_BINOP_CASE(name, type, operation) \
|
||||
case kExpr##name: { \
|
||||
type val; \
|
||||
Address addr; \
|
||||
if (!ExtractAtomicBinOpParams<type>(decoder, code, addr, pc, val, len)) { \
|
||||
return false; \
|
||||
} \
|
||||
static_assert(sizeof(std::atomic<std::type>) == sizeof(type), \
|
||||
"Size mismatch for types std::atomic<std::" #type \
|
||||
">, and " #type); \
|
||||
result = WasmValue( \
|
||||
std::operation(reinterpret_cast<std::atomic<std::type>*>(addr), val)); \
|
||||
break; \
|
||||
}
|
||||
#endif
|
||||
ATOMIC_BINOP_CASE(I32AtomicAdd, uint32_t, atomic_fetch_add);
|
||||
|
Loading…
Reference in New Issue
Block a user