mesa/util: use DETECT_OS_ANDROID in anon_file.c
glibc based Android build define ANDROID, but don't have memfd headers. Reviewed-by: Aaron Ruby <aruby@blackberry.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26874>
This commit is contained in:

committed by
Marge Bot

parent
1b133ad446
commit
c860935501
@@ -28,6 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "anon_file.h"
|
||||
#include "detect_os.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
|
||||
#if defined(HAVE_MEMFD_CREATE) || defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||
#include <sys/mman.h>
|
||||
#elif defined(ANDROID)
|
||||
#elif DETECT_OS_ANDROID
|
||||
#include <sys/syscall.h>
|
||||
#include <linux/memfd.h>
|
||||
#else
|
||||
@@ -120,7 +121,7 @@ os_create_anonymous_file(int64_t size, const char *debug_name)
|
||||
if (!debug_name)
|
||||
debug_name = "mesa-shared";
|
||||
fd = memfd_create(debug_name, MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
||||
#elif defined(ANDROID)
|
||||
#elif DETECT_OS_ANDROID
|
||||
if (!debug_name)
|
||||
debug_name = "mesa-shared";
|
||||
fd = syscall(SYS_memfd_create, debug_name, MFD_CLOEXEC | MFD_ALLOW_SEALING);
|
||||
|
Reference in New Issue
Block a user