summaryrefslogtreecommitdiff
path: root/lib/compat/glob.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-06-26 17:39:38 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-07-31 15:56:48 +0300
commit35a4212180272b5dd648b99c07a692aab19a5e67 (patch)
treefcdae2112a6f3dfac3fd004386000eb4e458b2ec /lib/compat/glob.c
parentfb78d87b33ab0380fbfddd539959225cb1f7c1f2 (diff)
lib: glob: Fix compilation on Android
The glibc glob() implementation doesn't compile on Android due to missing support for getlogin_r (before Android ABI 28) and to missing __THROW, __THROWNL and __attribute_noinline__ macros. getlogin_r is only used to implement support for the '~' path component which we don't use in the uvc-gadget library, so we can compile it out. The three macros can safely be defined as no-op. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'lib/compat/glob.c')
-rw-r--r--lib/compat/glob.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/compat/glob.c b/lib/compat/glob.c
index e48b030..28fd48e 100644
--- a/lib/compat/glob.c
+++ b/lib/compat/glob.c
@@ -23,6 +23,12 @@
#define __glibc_unlikely(x) x
#define __libc_use_alloca(x) 0
#define alloca_account(size, avar) alloca(size)
+#ifndef __THROWNL
+#define __THROWNL
+#endif
+#ifndef __attribute_noinline__
+#define __attribute_noinline__
+#endif
#include <glob.h>
@@ -604,7 +610,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
}
}
-#ifndef VMS
+#if !defined(VMS) && !defined(ANDROID)
if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/'
@@ -973,7 +979,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
}
# endif /* Not Amiga && not WINDOWS32. */
}
-#endif /* Not VMS. */
+#endif /* Not VMS && not ANDROID. */
/* Now test whether we looked for "~" or "~NAME". In this case we
can give the answer now. */