Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-05-31 12:35:51 +0400
committerJunio C Hamano <gitster@pobox.com>2009-06-01 04:57:59 +0400
commite1c068869216c8c231c1585bbfa9fda42b4756f8 (patch)
tree929b5984b0ce8bfaba925a84ebb5ae04e7559e28 /git-compat-util.h
parent0620b39b3b7b1f27bf863d9591fd8146a9a8931d (diff)
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>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h7
1 files changed, 7 insertions, 0 deletions
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 <libgen.h>
+#else
+#define basename gitbasename
+extern char *gitbasename(char *);
+#endif
+
#ifndef NO_ICONV
#include <iconv.h>
#endif