diff options
author | Elliott Hughes <enh@google.com> | 2015-07-11 14:20:31 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2015-07-11 14:20:31 -0500 |
commit | ba555808e068d9cc418b6b3bd6fa4238877a599d (patch) | |
tree | 994daae8252fe6040fc399f0e373b346275797ed | |
parent | 6292beb86fa9a3999f0f0b76185e0a893af85cd0 (diff) | |
download | toybox-ba555808e068d9cc418b6b3bd6fa4238877a599d.tar.gz toybox-ba555808e068d9cc418b6b3bd6fa4238877a599d.tar.bz2 toybox-ba555808e068d9cc418b6b3bd6fa4238877a599d.zip |
Fix 32-bit bionic toybox build.
https://android-review.googlesource.com/159035/
-rw-r--r-- | lib/portability.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/portability.h b/lib/portability.h index f83cab6..ff22fa5 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -79,7 +79,7 @@ char *strptime(const char *buf, const char *format, struct tm *tm); // correct name to the broken name. char *dirname(char *path); -char *__xpg_basename (char *path); +char *__xpg_basename(char *path); static inline char *basename(char *path) { return __xpg_basename(path); } // uClibc pretends to be glibc and copied a lot of its bugs, but has a few more @@ -154,11 +154,19 @@ int utimensat(int fd, const char *path, const struct timespec times[2], int flag #endif // glibc in general -#ifndef __GLIBC__ +#if !defined(__GLIBC__) && !defined(__BIONIC__) // POSIX basename. #include <libgen.h> #endif +// glibc was handled above; for 32-bit bionic we need to avoid a collision +// with toybox's basename_r so we can't include <libgen.h> even though that +// would give us a POSIX basename(3). +#if defined(__BIONIC__) +char *basename(char *path); +char *dirname(char *path); +#endif + // Work out how to do endianness #ifndef __APPLE__ |