]> git.ipfire.org Git - thirdparty/git.git/commit - config.mak.uname
git-compat-util: work around fileno(fp) that is a macro
authorDuy Nguyen <pclouds@gmail.com>
Tue, 12 Feb 2019 14:14:41 +0000 (21:14 +0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 12 Feb 2019 18:01:59 +0000 (10:01 -0800)
commit18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164
tree8ba3c3bc28c1eae9f19ce47e7fca682ee0e4a895
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c
git-compat-util: work around fileno(fp) that is a macro

On various BSD's, fileno(fp) is implemented as a macro that directly
accesses the fields in the FILE * object, which breaks a function that
accepts a "void *fp" parameter and calls fileno(fp) and expect it to
work.

Work it around by adding a compile-time knob FILENO_IS_A_MACRO that
inserts a real helper function in the middle of the callchain.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
compat/fileno.c [new file with mode: 0644]
config.mak.uname
git-compat-util.h