Skip to content

Commit a20b092

Browse files
committed
Fix type ambiguity in xbuffer with SDL2 calls
Close #178
1 parent 2aabd62 commit a20b092

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/Network/NetConnection.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,10 @@ int32_t NetConnection::send(const XBuffer* data, NETID source, NETID destination
430430
header |= (static_cast<uint64_t>(flags & 0xFFFF) << 8);
431431
header |= (static_cast<uint64_t>(body_len & 0xFFFFFFFF) << 24);
432432
XBuffer xbuf(msg_size);
433-
xbuf < SDL_SwapBE64(header);
434-
xbuf < SDL_SwapBE64(source);
435-
xbuf < SDL_SwapBE64(destination);
433+
//NOTE: Use write<> with explicit type to avoid type ambiguity from SDL_SwapBE64 in some archs
434+
xbuf.write<uint64_t>(SDL_SwapBE64(header));
435+
xbuf.write<uint64_t>(SDL_SwapBE64(source));
436+
xbuf.write<uint64_t>(SDL_SwapBE64(destination));
436437
xbuf.write(sending_buffer, sending_buffer.tell());
437438

438439
#ifdef PERIMETER_DEBUG

0 commit comments

Comments
 (0)