1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

AK+Lagom: Make it possible to build for iOS

This commit makes it possible to build AK and most of Lagom for iOS,
based on the work for the Ladybird build demoed on discord:
https://discord.com/channels/830522505605283862/830525031720943627/1211987732646068314
This commit is contained in:
Filiph Siitam Sandström 2024-02-27 14:32:29 +01:00 committed by Andrew Kaster
parent 2dce453f11
commit fd694e8672
17 changed files with 44 additions and 31 deletions

View file

@ -80,7 +80,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
VERIFY(m_listening);
sockaddr_in in;
socklen_t in_size = sizeof(in);
#if !defined(AK_OS_MACOS) && !defined(AK_OS_HAIKU)
#if !defined(AK_OS_MACOS) && !defined(AK_OS_IOS) && !defined(AK_OS_HAIKU)
int accepted_fd = TRY(Core::System::accept4(m_fd, (sockaddr*)&in, &in_size, SOCK_NONBLOCK | SOCK_CLOEXEC));
#else
int accepted_fd = TRY(Core::System::accept(m_fd, (sockaddr*)&in, &in_size));
@ -88,7 +88,7 @@ ErrorOr<NonnullOwnPtr<TCPSocket>> TCPServer::accept()
auto socket = TRY(TCPSocket::adopt_fd(accepted_fd));
#if defined(AK_OS_MACOS) || defined(AK_OS_HAIKU)
#if defined(AK_OS_MACOS) || defined(AK_OS_IOS) || defined(AK_OS_HAIKU)
// FIXME: Ideally, we should let the caller decide whether it wants the
// socket to be nonblocking or not, but there are currently places
// which depend on this.