Commit 0def18290376573cf4e8faae071f33e73d163b1a

Guillem Jover 2017-06-01T03:00:05

Stop using non-portable <sys/param.h> There are platforms without <sys/param.h>, so we better avoid the header altogether, and add the required MIN macro outselves. Based-on-patch-by: Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>

diff --git a/configure.ac b/configure.ac
index 9baffad..d3e6a24 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,6 @@ AC_PROG_CC
 # Checks for libraries.
 
 # Checks for header files.
-AC_CHECK_HEADERS([sys/param.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_BIGENDIAN
diff --git a/src/helper.c b/src/helper.c
index b0875bd..2a06503 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -11,7 +11,6 @@
 
 #include <config.h>
 
-#include <sys/param.h>
 #include <sys/stat.h>
 
 #include <errno.h>
@@ -23,6 +22,10 @@
 
 #include <hashinc>
 
+#ifndef MIN
+# define MIN(x, y) (((x) < (y)) ? (x) : (y))
+#endif
+
 /* ARGSUSED */
 char *
 HASHEnd(HASH_CTX *ctx, char *buf)
diff --git a/src/sha1.c b/src/sha1.c
index 2f04b82..2eacabe 100644
--- a/src/sha1.c
+++ b/src/sha1.c
@@ -16,7 +16,6 @@
 
 #include <config.h>
 
-#include <sys/param.h>
 #include <string.h>
 #include <sha1.h>