summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDuy Nguyen <pclouds@gmail.com>2019-02-12 14:14:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-12 18:01:59 (GMT)
commit18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164 (patch)
tree8ba3c3bc28c1eae9f19ce47e7fca682ee0e4a895 /Makefile
parent0d0ac3826a3bbb9247e39e12623bbcfdd722f24c (diff)
downloadgit-18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164.zip
git-18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164.tar.gz
git-18a4f6be6b4cfc34de6f80c36ab3ef951a0f7164.tar.bz2
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>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1a44c81..08d9961 100644
--- a/Makefile
+++ b/Makefile
@@ -427,6 +427,8 @@ all::
#
# Define HAVE_GETDELIM if your system has the getdelim() function.
#
+# Define FILENO_IS_A_MACRO if fileno() is a macro, not a real function.
+#
# Define PAGER_ENV to a SP separated VAR=VAL pairs to define
# default environment variables to be passed when a pager is spawned, e.g.
#
@@ -1773,6 +1775,11 @@ ifdef HAVE_WPGMPTR
BASIC_CFLAGS += -DHAVE_WPGMPTR
endif
+ifdef FILENO_IS_A_MACRO
+ COMPAT_CFLAGS += -DFILENO_IS_A_MACRO
+ COMPAT_OBJS += compat/fileno.o
+endif
+
ifeq ($(TCLTK_PATH),)
NO_TCLTK = NoThanks
endif