1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #2058 - apply additional patches from dbsoft for OS defines

This commit is contained in:
Basilisk-Dev
2023-08-31 08:44:34 -04:00
committed by roytam1
parent 81d8af6565
commit 0e0bd83fe2
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -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);
+6 -6
View File
@@ -6,7 +6,7 @@
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#if !defined(__Userspace_os_Windows)
#if !defined(_WIN32)
#include <arpa/inet.h>
#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<struct sockaddr *>(&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