From 3050c16aea011dca101a7b569d956a25763b537f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sat, 20 May 2023 12:39:09 +0200 Subject: [PATCH] gio: define hasmntopt ourselves under bionic libc This is a workaround for build conditions one ends up with under termux, where the defined __ANDROID_API__ level is lower than what is provided by gcc installed for it, the libc .so nevertheless contains these symbols thus enabling the codepaths. This definition is only in use when meson detected the presence of this symbol in the libc. Fixes #3008 foo --- gio/gunixmounts.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c index 6477ee3a4..1cfd25d9e 100644 --- a/gio/gunixmounts.c +++ b/gio/gunixmounts.c @@ -46,6 +46,15 @@ #include #include +#if defined(__BIONIC__) && (__ANDROID_API__ < 26) +#include +/* the shared object of recent bionic libc's have hasmntopt symbol, but + some a possible common build environment for android, termux ends + up with inssuficient __ANDROID_API__ value for building. +*/ +extern char* hasmntopt(const struct mntent* mnt, const char* opt); +#endif + #if HAVE_SYS_STATFS_H #include #endif