Skip to content

Commit

Permalink
Fix type ambiguity in xbuffer with SDL2 calls
Browse files Browse the repository at this point in the history
Close #178
  • Loading branch information
IonAgorria committed Aug 21, 2024
1 parent 2aabd62 commit a20b092
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/Network/NetConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,10 @@ int32_t NetConnection::send(const XBuffer* data, NETID source, NETID destination
header |= (static_cast<uint64_t>(flags & 0xFFFF) << 8);
header |= (static_cast<uint64_t>(body_len & 0xFFFFFFFF) << 24);
XBuffer xbuf(msg_size);
xbuf < SDL_SwapBE64(header);
xbuf < SDL_SwapBE64(source);
xbuf < SDL_SwapBE64(destination);
//NOTE: Use write<> with explicit type to avoid type ambiguity from SDL_SwapBE64 in some archs
xbuf.write<uint64_t>(SDL_SwapBE64(header));
xbuf.write<uint64_t>(SDL_SwapBE64(source));
xbuf.write<uint64_t>(SDL_SwapBE64(destination));
xbuf.write(sending_buffer, sending_buffer.tell());

#ifdef PERIMETER_DEBUG
Expand Down

0 comments on commit a20b092

Please sign in to comment.