diff --git a/include/wabt/common.h b/include/wabt/common.h --- a/include/wabt/common.h +++ b/include/wabt/common.h @@ -18,7 +18,6 @@ #define WABT_COMMON_H_ #include -#include #include #include #include @@ -162,9 +161,12 @@ struct v128 { namespace wabt { template -Dst WABT_VECTORCALL Bitcast(const Src& value) { - return std::bit_cast(value); -} +Dst WABT_VECTORCALL Bitcast(Src&& value) { + static_assert(sizeof(Src) == sizeof(Dst), "Bitcast sizes must match."); + Dst result; + memcpy(&result, &value, sizeof(result)); + return result; + } template void ZeroMemory(T& v) {