summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorLibravatar Johannes Sixt <j.sixt@viscovery.net>2008-05-08 09:34:49 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-05-08 17:47:25 -0700
commitc5445fe0908d0bd8a062e0d29d9dcf4e4962e3c8 (patch)
treec743f7f02786d8c364c4fae01dc04913ca8ad0f3 /git-compat-util.h
parentcompat/fopen.c: avoid clobbering the system defined fopen macro (diff)
downloadtgif-c5445fe0908d0bd8a062e0d29d9dcf4e4962e3c8.tar.xz
compat-util: avoid macro redefinition warning
Some systems define fopen as a macro based on compiler settings, and unconditionally redefining it triggers a compilation warning.
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 167c3fe63a..01c4045e89 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -206,6 +206,9 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
#endif
#ifdef FREAD_READS_DIRECTORIES
+#ifdef fopen
+#undef fopen
+#endif
#define fopen(a,b) git_fopen(a,b)
extern FILE *git_fopen(const char*, const char*);
#endif