iOS - Platform Checks

Co-authored-by: riperiperi <rhy3756547@hotmail.com>
This commit is contained in:
Isaac Marovitz 2024-01-01 15:35:30 -08:00 committed by Emmanuel Hansen
parent 5d919039d9
commit 66e58aa6a7
21 changed files with 67 additions and 38 deletions

View file

@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
public IpAddressSetting(IPInterfaceProperties interfaceProperties, UnicastIPAddressInformation unicastIPAddressInformation)
{
IsDhcpEnabled = OperatingSystem.IsMacOS() || interfaceProperties.DhcpServerAddresses.Count != 0;
IsDhcpEnabled = (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS()) || interfaceProperties.DhcpServerAddresses.Count != 0;
Address = new IpV4Address(unicastIPAddressInformation.Address);
IPv4Mask = new IpV4Address(unicastIPAddressInformation.IPv4Mask);
GatewayAddress = (interfaceProperties.GatewayAddresses.Count == 0) ? new IpV4Address() : new IpV4Address(interfaceProperties.GatewayAddresses[0].Address);

View file

@ -91,7 +91,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl
{ 0, 0 },
};
private static readonly Dictionary<int, LinuxError> _errorMapMacOs = new()
private static readonly Dictionary<int, LinuxError> _errorMapDarwin = new()
{
{ 35, LinuxError.EAGAIN },
{ 11, LinuxError.EDEADLOCK },
@ -283,9 +283,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl
public static LinuxError ConvertError(WsaError errorCode)
{
if (OperatingSystem.IsMacOS())
if (OperatingSystem.IsMacOS() || OperatingSystem.IsIOS())
{
if (_errorMapMacOs.TryGetValue((int)errorCode, out LinuxError errno))
if (_errorMapDarwin.TryGetValue((int)errorCode, out LinuxError errno))
{
return errno;
}