Commit 0be828dc authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

[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/757178Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#49205}
parent 2f550ff3
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment