From ec13e1ccfb5e2c80058424add75b26cee21384d3 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sat, 30 Nov 2024 19:02:56 +0200 Subject: [PATCH] android pls --- third_party/host_memory/host_memory.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/third_party/host_memory/host_memory.cpp b/third_party/host_memory/host_memory.cpp index abcadaa6..979e7cb8 100644 --- a/third_party/host_memory/host_memory.cpp +++ b/third_party/host_memory/host_memory.cpp @@ -5,10 +5,6 @@ #define ARCHITECTURE_arm64 #endif -#ifndef __ANDROID__ -#define USING_FD -#endif - #ifdef _WIN32 #include @@ -38,15 +34,12 @@ #define MAP_NORESERVE 0 #endif - -#ifdef USING_FD -#define MAYBE_ANONYMOUS(flags) (flags) -#else -#define MAYBE_ANONYMOUS(flags) (flags) | MAP_ANONYMOUS -#endif - #endif // ^^^ Linux ^^^ +#ifdef __ANDROID__ +#include +#endif + #include #include #include @@ -448,10 +441,10 @@ namespace Common { #if defined(__FreeBSD__) && __FreeBSD__ < 13 // XXX Drop after FreeBSD 12.* reaches EOL on 2024-06-30 fd = shm_open(SHM_ANON, O_RDWR, 0600); -#elif defined(USING_FD) +#elif defined(__ANDROID__) fd = memfd_create("HostMemory", 0); #else - fd = -1; + fd = ASharedMemory_create("HostMemory", 0); #endif #ifdef USING_FD