Skip to content

Commit

Permalink
Fix endian
Browse files Browse the repository at this point in the history
  • Loading branch information
gavv committed Feb 2, 2022
1 parent cee2df8 commit de97d82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ std::string CodeToString(UInt32 value)

std::stringstream ss;

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
ss << "'" << bytes[0] << bytes[1] << bytes[2] << bytes[3] << "'";
#else
ss << "'" << bytes[3] << bytes[2] << bytes[1] << bytes[0] << "'";
#endif

ss << " (0x" << std::hex << value << ")";

return ss.str();
Expand Down

0 comments on commit de97d82

Please sign in to comment.