1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

Everywhere: Replace uses of __serenity__ with AK_OS_SERENITY

Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
This commit is contained in:
Andrew Kaster 2022-10-09 15:23:23 -06:00 committed by Linus Groh
parent 896d4e8dc1
commit 828441852f
46 changed files with 118 additions and 113 deletions

View file

@ -498,7 +498,7 @@ Bitmap::~Bitmap()
void Bitmap::set_mmap_name([[maybe_unused]] String const& name)
{
VERIFY(m_needs_munmap);
#ifdef __serenity__
#ifdef AK_OS_SERENITY
::set_mmap_name(m_data, size_in_bytes(), name.characters());
#endif
}
@ -516,7 +516,7 @@ void Bitmap::set_volatile()
{
if (m_volatile)
return;
#ifdef __serenity__
#ifdef AK_OS_SERENITY
int rc = madvise(m_data, size_in_bytes(), MADV_SET_VOLATILE);
if (rc < 0) {
perror("madvise(MADV_SET_VOLATILE)");
@ -533,7 +533,7 @@ void Bitmap::set_volatile()
return true;
}
#ifdef __serenity__
#ifdef AK_OS_SERENITY
int rc = madvise(m_data, size_in_bytes(), MADV_SET_NONVOLATILE);
if (rc < 0) {
if (errno == ENOMEM) {
@ -566,7 +566,7 @@ ErrorOr<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, IntSiz
auto const data_size_in_bytes = size_in_bytes(pitch, size.height() * scale_factor);
int map_flags = MAP_ANONYMOUS | MAP_PRIVATE;
#ifdef __serenity__
#ifdef AK_OS_SERENITY
map_flags |= MAP_PURGEABLE;
void* data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, String::formatted("GraphicsBitmap [{}]", size).characters());
#else