Skip to content

Commit

Permalink
Turn off PACKET_DESTINATION_INFO for mingw-w64.
Browse files Browse the repository at this point in the history
The CMSG_* macros used in CycloneDDS are not provided by mingw-w64-gcc (only WSA*).
Set the number of bytes received also for nonzero return from wsarecvmsg.
Closes eclipse-cyclonedds#2027
  • Loading branch information
tonichedgehog authored and Johan Pelo committed Jun 19, 2024
1 parent 545f4cb commit fd10bdc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/ddsi/src/ddsi_udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ DDSRT_STATIC_ASSERT (DDSI_LOCATOR_UDPv4MCGEN_INDEX_MASK_BITS <= 32 - UDP_MC_ADDR
# endif
#endif
#ifndef PACKET_DESTINATION_INFO
# if defined (__MINGW32__) && !defined (CMSG_SPACE)
# define PACKET_DESTINATION_INFO 0
# endif
# if defined CMSG_SPACE && (defined IP_PKTINFO || (DDSRT_HAVE_IPV6 && defined IPV6_PKTINFO))
# define PACKET_DESTINATION_INFO 1
# else
Expand Down
1 change: 1 addition & 0 deletions src/ddsrt/src/sockets/windows/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ ddsrt_recvmsg(
if (sockext->wsarecvmsg (sockext->sock, &wsamsg, &n, NULL, 0) != 0)
{
int err = WSAGetLastError();
*rcvd = (ssize_t) n;
return recv_error_to_retcode(err);
}
else
Expand Down

0 comments on commit fd10bdc

Please sign in to comment.