mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Everywhere: Add support for compilation under emscripten
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
parent
84502f53b5
commit
2110e7cf85
9 changed files with 50 additions and 16 deletions
|
@ -34,7 +34,7 @@ set(SOURCES
|
|||
UDPServer.cpp
|
||||
Version.cpp
|
||||
)
|
||||
if (NOT ANDROID AND NOT WIN32)
|
||||
if (NOT ANDROID AND NOT WIN32 AND NOT EMSCRIPTEN)
|
||||
list(APPEND SOURCES
|
||||
Account.cpp
|
||||
FilePermissionsMask.cpp
|
||||
|
|
|
@ -44,7 +44,9 @@ MappedFile::MappedFile(void* ptr, size_t size)
|
|||
|
||||
MappedFile::~MappedFile()
|
||||
{
|
||||
MUST(Core::System::munmap(m_data, m_size));
|
||||
auto res = Core::System::munmap(m_data, m_size);
|
||||
if (res.is_error())
|
||||
dbgln("Failed to unmap MappedFile (@ {:p}): {}", m_data, res.error());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
@ -29,6 +28,7 @@
|
|||
# include <LibCore/Account.h>
|
||||
# include <LibSystem/syscall.h>
|
||||
# include <serenity.h>
|
||||
# include <sys/ptrace.h>
|
||||
#endif
|
||||
|
||||
#if defined(AK_OS_LINUX) && !defined(MFD_CLOEXEC)
|
||||
|
@ -319,7 +319,7 @@ ErrorOr<int> anon_create([[maybe_unused]] size_t size, [[maybe_unused]] int opti
|
|||
TRY(close(fd));
|
||||
return Error::from_errno(saved_errno);
|
||||
}
|
||||
#elif defined(AK_OS_MACOS)
|
||||
#elif defined(AK_OS_MACOS) || defined(AK_OS_EMSCRIPTEN)
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_REALTIME, &time);
|
||||
auto name = String::formatted("/shm-{}{}", (unsigned long)time.tv_sec, (unsigned long)time.tv_nsec);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue