projects/aports·blob master · refs

43 lines · 1.1 KiB

1https://bugs.gentoo.org/937495
2From: Brahmajit Das <[email protected]>
3Date: Tue, 3 Sep 2024 06:14:54 +0000
4Subject: [PATCH 1/1] xfsdump: Mimic GNU basename() API for non-glibc library
5 e.g. musl
6
7musl only provides POSIX version of basename and it has also removed
8providing it via string.h header [1] which now results in compile errors
9with newer compilers e.g. clang-18
10
11[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
12
13Please also reffer: https://bugs.gentoo.org/937495
14
15Signed-off-by: Brahmajit Das <[email protected]>
16--- a/common/main.c
17+++ b/common/main.c
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--- a/invutil/invidx.c
29+++ b/invutil/invidx.c
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--
422.46.0
43