git-compat-util: work around fileno(fp) that is a macro
[gitweb.git] / Makefile
index 1a44c811aa56330327172cf693c61f9a221e4e16..08d9961425dbb88cbc7a2970231444588fd6379c 100644 (file)
--- 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