From e1c068869216c8c231c1585bbfa9fda42b4756f8 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sun, 31 May 2009 01:35:51 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- git-compat-util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'git-compat-util.h') diff --git a/git-compat-util.h b/git-compat-util.h index f7217ad430..71445c6aac 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -97,6 +97,13 @@ #include "compat/mingw.h" #endif /* __MINGW32__ */ +#ifndef NO_LIBGEN_H +#include +#else +#define basename gitbasename +extern char *gitbasename(char *); +#endif + #ifndef NO_ICONV #include #endif -- cgit v1.2.1