From e2e3a8e007ac2a9533f4205622a6e17d57845fcc Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 24 Apr 2006 14:09:07 +0000 Subject: r15200: Move MIN/MAX macros to libreplace as some systems have them in sys/param.h (This used to be commit 3f0396aade82a92a375275059baf8500de1b23f0) --- source4/build/m4/rewrite.m4 | 2 +- source4/lib/replace/README | 2 ++ source4/lib/replace/config.m4 | 2 ++ source4/lib/replace/replace.h | 14 ++++++++++++++ source4/lib/util/util.h | 14 -------------- 5 files changed, 19 insertions(+), 15 deletions(-) (limited to 'source4') diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4 index 9771dabfa6..e6709f0727 100644 --- a/source4/build/m4/rewrite.m4 +++ b/source4/build/m4/rewrite.m4 @@ -53,7 +53,7 @@ AC_HEADER_TIME AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(sys/select.h fcntl.h sys/fcntl.h sys/time.h stdarg.h) AC_CHECK_HEADERS(utime.h grp.h sys/id.h limits.h compat.h math.h) -AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h) +AC_CHECK_HEADERS(ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h) AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h) AC_CHECK_HEADERS(sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h) AC_CHECK_HEADERS(fnmatch.h pwd.h sys/termio.h sys/time.h) 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 +#endif + +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif + +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif + + + #endif diff --git a/source4/lib/util/util.h b/source4/lib/util/util.h index 8a2a9163d6..302bd06323 100644 --- a/source4/lib/util/util.h +++ b/source4/lib/util/util.h @@ -76,20 +76,6 @@ extern const char *panic_action; DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__)); \ smb_panic("assert failed"); abort(); }} while (0) -/** - * determine the lowest of two values - */ -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif - -/** - * determine the highest of two values - */ -#ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) -#endif - /** * determine absolute value */ -- cgit