From 0e0bd83fe205802c14cebc45b3e367a9b02703e0 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Thu, 31 Aug 2023 08:44:34 -0400 Subject: [PATCH] Issue #2058 - apply additional patches from dbsoft for OS defines --- media/mtransport/test/sctp_unittest.cpp | 4 ++-- netwerk/sctp/datachannel/DataChannel.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/media/mtransport/test/sctp_unittest.cpp b/media/mtransport/test/sctp_unittest.cpp index 2dbfc9c03d..267f199d12 100644 --- a/media/mtransport/test/sctp_unittest.cpp +++ b/media/mtransport/test/sctp_unittest.cpp @@ -97,7 +97,7 @@ class TransportTestPeer : public sigslot::has_slots<> { memset(&local_addr_, 0, sizeof(local_addr_)); local_addr_.sconn_family = AF_CONN; -#if !defined(__Userspace_os_Linux) && !defined(__Userspace_os_Windows) && !defined(__Userspace_os_Android) +#if !defined(__linux__) && !defined(_WIN32) && !defined(__ANDROID__) local_addr_.sconn_len = sizeof(struct sockaddr_conn); #endif local_addr_.sconn_port = htons(local_port); @@ -106,7 +106,7 @@ class TransportTestPeer : public sigslot::has_slots<> { memset(&remote_addr_, 0, sizeof(remote_addr_)); remote_addr_.sconn_family = AF_CONN; -#if !defined(__Userspace_os_Linux) && !defined(__Userspace_os_Windows) && !defined(__Userspace_os_Android) +#if !defined(__linux__) && !defined(_WIN32) && !defined(__ANDROID__) remote_addr_.sconn_len = sizeof(struct sockaddr_conn); #endif remote_addr_.sconn_port = htons(remote_port); diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index 9130d787e1..45e64ee4b7 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -6,7 +6,7 @@ #include #include #include -#if !defined(__Userspace_os_Windows) +#if !defined(_WIN32) #include #endif // usrsctp.h expects to have errno definitions prior to its inclusion. @@ -547,7 +547,7 @@ DataChannelConnection::CompleteConnect(TransportFlow *flow, TransportLayer::Stat struct sockaddr_conn addr; memset(&addr, 0, sizeof(addr)); addr.sconn_family = AF_CONN; -#if defined(__Userspace_os_Darwin) +#if defined(__APPLE__) addr.sconn_len = sizeof(addr); #endif addr.sconn_port = htons(mLocalPort); @@ -801,7 +801,7 @@ DataChannelConnection::Connect(const char *addr, unsigned short port) addr6.sin6_port = htons(port); mState = CONNECTING; -#if !defined(__Userspace_os_Windows) +#if !defined(_WIN32) if (inet_pton(AF_INET6, addr, &addr6.sin6_addr) == 1) { if (usrsctp_connect(mMasterSocket, reinterpret_cast(&addr6), sizeof(struct sockaddr_in6)) < 0) { LOG(("*** Failed userspace_connect")); @@ -1555,7 +1555,7 @@ void DataChannelConnection::HandlePeerAddressChangeEvent(const struct sctp_paddr_change *spc) { const char *addr = ""; -#if !defined(__Userspace_os_Windows) +#if !defined(_WIN32) char addr_buf[INET6_ADDRSTRLEN]; struct sockaddr_in *sin; struct sockaddr_in6 *sin6; @@ -1563,13 +1563,13 @@ DataChannelConnection::HandlePeerAddressChangeEvent(const struct sctp_paddr_chan switch (spc->spc_aaddr.ss_family) { case AF_INET: -#if !defined(__Userspace_os_Windows) +#if !defined(_WIN32) sin = (struct sockaddr_in *)&spc->spc_aaddr; addr = inet_ntop(AF_INET, &sin->sin_addr, addr_buf, INET6_ADDRSTRLEN); #endif break; case AF_INET6: -#if !defined(__Userspace_os_Windows) +#if !defined(_WIN32) sin6 = (struct sockaddr_in6 *)&spc->spc_aaddr; addr = inet_ntop(AF_INET6, &sin6->sin6_addr, addr_buf, INET6_ADDRSTRLEN); #endif