mirror of
https://github.com/badaix/snapcast.git
synced 2025-04-29 10:17:16 +02:00
Fix compilation on big endian systems
This commit is contained in:
parent
5513d94285
commit
b4b9eb83ce
1 changed files with 2 additions and 2 deletions
|
@ -242,7 +242,7 @@ protected:
|
|||
|
||||
void writeVal(std::ostream& stream, const message_type& val) const
|
||||
{
|
||||
uint16_t v = static_cast<uint16_t>(SWAP_16(val));
|
||||
uint16_t v = static_cast<uint16_t>(SWAP_16(static_cast<uint16_t>(val)));
|
||||
stream.write(reinterpret_cast<const char*>(&v), sizeof(uint16_t));
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ protected:
|
|||
void readVal(std::istream& stream, message_type& val) const
|
||||
{
|
||||
stream.read(reinterpret_cast<char*>(&val), sizeof(uint16_t));
|
||||
val = static_cast<message_type>(SWAP_16(val));
|
||||
val = static_cast<message_type>(SWAP_16(static_cast<uint16_t>(val)));
|
||||
}
|
||||
|
||||
void readVal(std::istream& stream, int16_t& val) const
|
||||
|
|
Loading…
Add table
Reference in a new issue