Merge branch 'nd/fileno-may-be-macro'

* nd/fileno-may-be-macro:
  git-compat-util: work around fileno(fp) that is a macro
This commit is contained in:
Junio C Hamano
2019-02-13 18:18:41 -08:00
4 changed files with 24 additions and 0 deletions

View File

@ -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