compat: add a basename() compatibility function
Some systems such as Windows lack libgen.h so provide a basename() implementation for cross-platform use. This introduces the NO_LIBGEN_H construct to the Makefile and autoconf scripts. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
0620b39b3b
commit
e1c0688692
@ -97,6 +97,13 @@
|
||||
#include "compat/mingw.h"
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#ifndef NO_LIBGEN_H
|
||||
#include <libgen.h>
|
||||
#else
|
||||
#define basename gitbasename
|
||||
extern char *gitbasename(char *);
|
||||
#endif
|
||||
|
||||
#ifndef NO_ICONV
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user