summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2024-11-20 19:13:48 +0100
committerDamien George <damien@micropython.org>2024-11-30 12:42:51 +1100
commit3de3821abf7e245566be227c9799b74d6b80aae3 (patch)
treee22011a6d1ea801aac749e6a053459ef97b5cd89
parent09cf01d7c1f564fd018bd8fb3e6382fbe8cd1e35 (diff)
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 <a.gatti@frob.it>
-rw-r--r--extmod/modplatform.h7
1 files changed, 6 insertions, 1 deletions
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"