From 3de3821abf7e245566be227c9799b74d6b80aae3 Mon Sep 17 00:00:00 2001 From: Alessandro Gatti Date: Wed, 20 Nov 2024 19:13:48 +0100 Subject: [PATCH] extmod/modplatform: Add Android to the recognised platforms list. This commit adds code to distinguish between regular Linux and Android, also adding a specific entry for the platform libc. The reported libc is marked as "bionic" and its version matches the Android platform API version (there are no definitions for a specific bionic version). Signed-off-by: Alessandro Gatti --- extmod/modplatform.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extmod/modplatform.h b/extmod/modplatform.h index 19246c0fd..5c9cbffb2 100644 --- a/extmod/modplatform.h +++ b/extmod/modplatform.h @@ -96,12 +96,17 @@ #elif defined(_PICOLIBC__) #define MICROPY_PLATFORM_LIBC_LIB "picolibc" #define MICROPY_PLATFORM_LIBC_VER _PICOLIBC_VERSION +#elif defined(__ANDROID__) +#define MICROPY_PLATFORM_LIBC_LIB "bionic" +#define MICROPY_PLATFORM_LIBC_VER MP_STRINGIFY(__ANDROID_API__) #else #define MICROPY_PLATFORM_LIBC_LIB "" #define MICROPY_PLATFORM_LIBC_VER "" #endif -#if defined(__linux) +#if defined(__ANDROID__) +#define MICROPY_PLATFORM_SYSTEM "Android" +#elif defined(__linux) #define MICROPY_PLATFORM_SYSTEM "Linux" #elif defined(__unix__) #define MICROPY_PLATFORM_SYSTEM "Unix"