Skip to content

Commit 3de3821

Browse files
agattidpgeorge
authored andcommitted
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 <[email protected]>
1 parent 09cf01d commit 3de3821

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

extmod/modplatform.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,17 @@
9696
#elif defined(_PICOLIBC__)
9797
#define MICROPY_PLATFORM_LIBC_LIB "picolibc"
9898
#define MICROPY_PLATFORM_LIBC_VER _PICOLIBC_VERSION
99+
#elif defined(__ANDROID__)
100+
#define MICROPY_PLATFORM_LIBC_LIB "bionic"
101+
#define MICROPY_PLATFORM_LIBC_VER MP_STRINGIFY(__ANDROID_API__)
99102
#else
100103
#define MICROPY_PLATFORM_LIBC_LIB ""
101104
#define MICROPY_PLATFORM_LIBC_VER ""
102105
#endif
103106

104-
#if defined(__linux)
107+
#if defined(__ANDROID__)
108+
#define MICROPY_PLATFORM_SYSTEM "Android"
109+
#elif defined(__linux)
105110
#define MICROPY_PLATFORM_SYSTEM "Linux"
106111
#elif defined(__unix__)
107112
#define MICROPY_PLATFORM_SYSTEM "Unix"

0 commit comments

Comments
 (0)