]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-compat-util.h: do not #include <sys/param.h> by default
authorJunio C Hamano <gitster@pobox.com>
Tue, 18 Dec 2012 17:35:33 +0000 (09:35 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Dec 2012 02:57:46 +0000 (18:57 -0800)
Earlier we allowed platforms that lack <sys/param.h> not to include
the header file from git-compat-util.h; we have included this header
file since the early days back when we used MAXPATHLEN (which we no
longer use) and also depended on it slurping ULONG_MAX (which we get
by including stdint.h or inttypes.h these days).

It turns out that we can compile our modern codebase just file
without including it on many platforms (so far, Fedora, Debian,
Ubuntu, MinGW, Mac OS X, Cygwin, HP-Nonstop, QNX and z/OS are
reported to be OK).

Let's stop including it by default, and on platforms that need it to
be included, leave "make NEEDS_SYS_PARAM_H=YesPlease" as an escape
hatch and ask them to report to us, so that we can find out about
the real dependency and fix it in a more platform agnostic way.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
configure.ac
git-compat-util.h

index 5cd1de02c78167fae20e0b11c8cad5f34dd6f2c7..2c1f04ff1a86dcd4158855eca7ed06ed7c79276b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -167,7 +167,9 @@ all::
 # Define NO_POLL if you do not have or don't want to use poll().
 # This also implies NO_SYS_POLL_H.
 #
-# Define NO_SYS_PARAM_H if you don't have sys/param.h.
+# Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
+# *PLEASE* REPORT to git@vger.kernel.org if your platform needs this;
+# we want to know more about the issue.
 #
 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
 #
@@ -1747,8 +1749,8 @@ endif
 ifdef NO_SYS_POLL_H
        BASIC_CFLAGS += -DNO_SYS_POLL_H
 endif
-ifdef NO_SYS_PARAM_H
-       BASIC_CFLAGS += -DNO_SYS_PARAM_H
+ifdef NEEDS_SYS_PARAM_H
+       BASIC_CFLAGS += -DNEEDS_SYS_PARAM_H
 endif
 ifdef NO_INTTYPES_H
        BASIC_CFLAGS += -DNO_INTTYPES_H
index e3ab6fe2826c1732ea7e6c4131d6396d86ba26fe..8fbb533d95179b0ecd0b556a89c1c0d4825b8f54 100644 (file)
@@ -699,12 +699,6 @@ AC_CHECK_HEADER([sys/poll.h],
 [NO_SYS_POLL_H=UnfortunatelyYes])
 GIT_CONF_SUBST([NO_SYS_POLL_H])
 #
-# Define NO_SYS_PARAM_H if you don't have sys/param.h
-AC_CHECK_HEADER([sys/param.h],
-[NO_SYS_PARAM_H=],
-[NO_SYS_PARAM_H=UnfortunatelyYes])
-GIT_CONF_SUBST([NO_SYS_PARAM_H])
-#
 # Define NO_INTTYPES_H if you don't have inttypes.h
 AC_CHECK_HEADER([inttypes.h],
 [NO_INTTYPES_H=],
index d7359ef87f14214f7bd0fd0f24078dc4abf6735a..a88147b2ddb798e20c0c4a5f55e31218d8486123 100644 (file)
 #endif
 #include <errno.h>
 #include <limits.h>
-#ifndef NO_SYS_PARAM_H
+#ifdef NEEDS_SYS_PARAM_H
 #include <sys/param.h>
 #endif
 #include <sys/types.h>