Skip to content

Commit f4f9da1

Browse files
committed
fix for issue 354
1 parent fd85e52 commit f4f9da1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/fast_float/ascii_number.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,19 @@ parse_int_string(UC const *p, UC const *pend, T &value,
532532
str[j] = static_cast<uint8_t>(p[j]);
533533
}
534534
digits = std::bit_cast<uint32_t>(str);
535+
#if FASTFLOAT_IS_BIG_ENDIAN
536+
digits = byteswap(digits);
537+
#endif
535538
}
536539
#else
537540
if (false) {
538541
}
539542
#endif
540543
else if (len >= 4) {
541544
::memcpy(&digits, p, 4);
545+
#if FASTFLOAT_IS_BIG_ENDIAN
546+
digits = byteswap(digits);
547+
#endif
542548
} else {
543549
uint32_t b0 = static_cast<uint8_t>(p[0]);
544550
uint32_t b1 = (len > 1) ? static_cast<uint8_t>(p[1]) : 0xFFu;

0 commit comments

Comments
 (0)