diff options
Diffstat (limited to 'shared/missing.h')
-rw-r--r-- | shared/missing.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/missing.h b/shared/missing.h index 2629444..7df6235 100644 --- a/shared/missing.h +++ b/shared/missing.h @@ -38,6 +38,7 @@ static inline int finit_module(int fd, const char *uargs, int flags) #endif #if !HAVE_DECL_STRNDUPA +#include <string.h> #define strndupa(s, n) \ ({ \ const char *__old = (s); \ @@ -48,6 +49,15 @@ static inline int finit_module(int fd, const char *uargs, int flags) }) #endif +#if !HAVE_DECL_BASENAME +#include <string.h> +static inline const char *basename(const char *s) +{ + const char *p = strrchr(s, '/'); + return p ? p + 1 : s; +} +#endif + #if !HAVE_DECL_BE32TOH #include <endian.h> #include <byteswap.h> |