summaryrefslogtreecommitdiff
path: root/source4/lib/replace
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/replace')
-rw-r--r--source4/lib/replace/README2
-rw-r--r--source4/lib/replace/config.m42
-rw-r--r--source4/lib/replace/replace.h14
3 files changed, 18 insertions, 0 deletions
diff --git a/source4/lib/replace/README b/source4/lib/replace/README
index 841bcf4b8d..a3e9d87072 100644
--- a/source4/lib/replace/README
+++ b/source4/lib/replace/README
@@ -68,6 +68,8 @@ UINT64_MAX
Macros:
va_copy
__FUNCTION__
+MIN
+MAX
Prerequisites:
memset (for bzero)
diff --git a/source4/lib/replace/config.m4 b/source4/lib/replace/config.m4
index fb6e791353..ada9566b58 100644
--- a/source4/lib/replace/config.m4
+++ b/source4/lib/replace/config.m4
@@ -159,3 +159,5 @@ samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
fi
+
+AC_CHECK_HEADERS([sys/param.h])
diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h
index 814936c49f..218fd4cb2a 100644
--- a/source4/lib/replace/replace.h
+++ b/source4/lib/replace/replace.h
@@ -213,4 +213,18 @@ typedef bool int;
#define __FUNCTION__ ("")
#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#ifndef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+
+#ifndef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#endif
+
+
+
#endif