kmod/shared
Khem Raj 11eb9bc67c Use portable implementation for basename API
musl has removed the non-prototype declaration of basename from
string.h [1] which now results in build errors with clang-17+ compiler

Implement GNU basename behavior using strchr which is portable across libcs

Fixes
../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
71 | "Commands:\n", basename(argv[0]));
| ^

[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

Suggested-by: Rich Felker

Signed-off-by: Khem Raj <raj.khem@gmail.com>
[ Implement a basename() function in missing.h and ensure we always use
  the right include rather than having a separate gnu_basename() ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-06-10 18:15:39 -05:00
..
.gitignore Move generic util functions to shared directory 2014-10-03 00:33:25 -03:00
array.c Fix includes after change to build-sys 2015-01-02 12:41:01 -02:00
array.h Move array implementation to shared directory 2014-10-03 00:33:25 -03:00
hash.c shared: avoid passing {NULL, 0} array to bsearch() 2023-05-30 22:36:43 -07:00
hash.h Move hash implementation to shared directory 2014-10-03 00:40:11 -03:00
macro.h shared: fix UNIQ definition 2020-12-27 16:40:08 -08:00
missing.h Use portable implementation for basename API 2024-06-10 18:15:39 -05:00
scratchbuf.c Add scratchbuf implementation 2016-08-15 10:26:42 -03:00
scratchbuf.h shared: make scratchbuf_str static 2016-11-10 22:14:27 -02:00
strbuf.c Remove FSF mailing address 2014-12-25 23:41:34 -02:00
strbuf.h shared: rename prefixes of strbuf functions 2014-10-11 13:25:51 -03:00
util.c Use portable implementation for basename API 2024-06-10 18:15:39 -05:00
util.h Use portable implementation for basename API 2024-06-10 18:15:39 -05:00