| 1 | https://bugs.gentoo.org/937495
|
| 2 | From: Brahmajit Das <[email protected]>
|
| 3 | Date: Tue, 3 Sep 2024 06:14:54 +0000
|
| 4 | Subject: [PATCH 1/1] xfsdump: Mimic GNU basename() API for non-glibc library
|
| 5 | e.g. musl
|
| 6 |
|
| 7 | musl only provides POSIX version of basename and it has also removed
|
| 8 | providing it via string.h header [1] which now results in compile errors
|
| 9 | with newer compilers e.g. clang-18
|
| 10 |
|
| 11 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
|
| 12 |
|
| 13 | Please also reffer: https://bugs.gentoo.org/937495
|
| 14 |
|
| 15 | Signed-off-by: Brahmajit Das <[email protected]>
|
| 16 | |
| 17 | |
| 18 | @@ -77,6 +77,9 @@
|
| 19 | #define MINSTACKSZ 0x02000000
|
| 20 | #define MAXSTACKSZ 0x08000000
|
| 21 |
|
| 22 | +#if !defined(__GLIBC__)
|
| 23 | +#define basename(src) (strrchr(src, '/') ? strrchr(src, '/') + 1 : src)
|
| 24 | +#endif
|
| 25 |
|
| 26 | /* declarations of externally defined global symbols *************************/
|
| 27 |
|
| 28 | |
| 29 | |
| 30 | @@ -41,6 +41,10 @@
|
| 31 | #include "stobj.h"
|
| 32 | #include "timeutil.h"
|
| 33 |
|
| 34 | +#if !defined(__GLIBC__)
|
| 35 | +#define basename(src) (strrchr(src, '/') ? strrchr(src, '/') + 1 : src)
|
| 36 | +#endif
|
| 37 | +
|
| 38 | invidx_fileinfo_t *invidx_file;
|
| 39 | int invidx_numfiles;
|
| 40 |
|
| 41 | --
|
| 42 | 2.46.0
|
| 43 |
|