mirror of
https://github.com/nlohmann/json.git
synced 2026-10-18 03:58:12 +00:00
Do proper endian conversions
This fixes all testsuite failures on big endian hosts.
This commit is contained in:
1 parent
e326df211b
commit
bb22b1003f
4 files changed
+6
-7
No files matched your search
@@ -1278,7 +1278,7 @@ class binary_writer
|
||||
std::memcpy(vec.data(), &n, sizeof(NumberType));
|
||||
|
||||
// step 2: write array to output (with possible reordering)
|
||||
if (is_little_endian and not OutputIsLittleEndian)
|
||||
if (is_little_endian != OutputIsLittleEndian)
|
||||
{
|
||||
// reverse byte order prior to conversion if necessary
|
||||
std::reverse(vec.begin(), vec.end());
|
||||
|
||||
Reference in new issue
Block a user