Skip to content

Commit de97d82

Browse files
committed
Fix endian
1 parent cee2df8 commit de97d82

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/Strings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ std::string CodeToString(UInt32 value)
1313

1414
std::stringstream ss;
1515

16+
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
1617
ss << "'" << bytes[0] << bytes[1] << bytes[2] << bytes[3] << "'";
18+
#else
19+
ss << "'" << bytes[3] << bytes[2] << bytes[1] << bytes[0] << "'";
20+
#endif
21+
1722
ss << " (0x" << std::hex << value << ")";
1823

1924
return ss.str();

0 commit comments

Comments
 (0)