summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-14 02:18:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-14 02:18:41 (GMT)
commit1db999ce8d369dbf20532f1b2ea8cbbcf6f2cc7b (patch)
tree2594969e363819ef50ad96ad999f352f35ea2a91 /git-compat-util.h
parentc73472a8deb9dc194d05747dda3061c6324750e4 (diff)
parent18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164 (diff)
downloadgit-1db999ce8d369dbf20532f1b2ea8cbbcf6f2cc7b.zip
git-1db999ce8d369dbf20532f1b2ea8cbbcf6f2cc7b.tar.gz
git-1db999ce8d369dbf20532f1b2ea8cbbcf6f2cc7b.tar.bz2
Merge branch 'nd/fileno-may-be-macro'
* nd/fileno-may-be-macro: git-compat-util: work around fileno(fp) that is a macro
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 29a1990..6573808 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -1234,6 +1234,14 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
#define getc_unlocked(fh) getc(fh)
#endif
+#ifdef FILENO_IS_A_MACRO
+int git_fileno(FILE *stream);
+# ifndef COMPAT_CODE
+# undef fileno
+# define fileno(p) git_fileno(p)
+# endif
+#endif
+
/*
* Our code often opens a path to an optional file, to work on its
* contents when we can successfully open it. We can ignore a failure