]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-compat-util.h
git-compat-util: work around fileno(fp) that is a macro
[thirdparty/git.git] / git-compat-util.h
index 09b0102cae8c8c0e39dc239003ca599a896730cf..7899f42f5ebbd77f34aed85f3f01245360328daa 100644 (file)
@@ -1220,6 +1220,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