mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
AK: Add a 'HostIsLittleEndian' constant and use it instead of BYTE_ORDER
Previously we were using the preprocessor everywhere we needed this constant, so let's move away from that and use a constexpr constant.
This commit is contained in:
parent
b3a295a5bd
commit
94f5389934
3 changed files with 26 additions and 27 deletions
|
@ -225,7 +225,7 @@ static ThrowCompletionOr<Value> atomic_compare_exchange_impl(VM& vm, TypedArrayB
|
|||
// 9. Let elementSize be TypedArrayElementSize(typedArray).
|
||||
|
||||
// 10. Let isLittleEndian be the value of the [[LittleEndian]] field of the surrounding agent's Agent Record.
|
||||
constexpr bool is_little_endian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
|
||||
constexpr bool is_little_endian = AK::HostIsLittleEndian;
|
||||
|
||||
// 11. Let expectedBytes be NumericToRawBytes(elementType, expected, isLittleEndian).
|
||||
auto expected_bytes = MUST_OR_THROW_OOM(numeric_to_raw_bytes<T>(vm, expected, is_little_endian));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue