Crossplatformity: MIN and MAX functiona are _always_ redefined, no #ifdefs
authorshort <>
Thu, 19 Apr 2001 17:43:19 +0000 (17:43 +0000)
committershort <>
Thu, 19 Apr 2001 17:43:19 +0000 (17:43 +0000)
  and/or autoconfing - caused #include conflicts on Alpha OSF1

acconfig.h
configure.in
mdsms.c

index ac1bcef..b7e0cf5 100644 (file)
 /* Disable runtime assertion checks. */
 #undef NDEBUG
 
-/* Provide stub for MAX-function if needed. */
-#undef HAVE_MAX
-#ifndef HAVE_MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
-/* Provide stub for MIN-function if needed. */
-#undef HAVE_MIN
-#ifndef HAVE_MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
 /* LINE_MAX from <limits.h>, provide default if not defined. */
 #undef HAVE_LINE_MAX
 #undef LINE_MAX
index 26fc971..6d6ab41 100644 (file)
@@ -112,14 +112,6 @@ AC_CHECK_HEADERS(assert.h ctype.h errno.h fcntl.h limits.h signal.h stdarg.h)
 AC_CHECK_HEADERS(stdio.h stdlib.h string.h sys/poll.h sys/stat.h sys/time.h)
 AC_CHECK_HEADERS(sys/types.h sys/wait.h termios.h time.h unistd.h)
 
-AC_CHECK_FUNC(MAX, AC_DEFINE(HAVE_MAX) ,
-       AC_CHECK_FUNC(max, AC_DEFINE(MAX, max) AC_DEFINE(HAVE_MAX))
-       )
-
-AC_CHECK_FUNC(MIN, AC_DEFINE(HAVE_MIN) ,
-       AC_CHECK_FUNC(min, AC_DEFINE(MIN, min) AC_DEFINE(HAVE_MIN))
-       )
-
 AC_MSG_CHECKING([for LINE_MAX])
 AC_TRY_COMPILE([
 #ifdef HAVE_LIMITS_H
diff --git a/mdsms.c b/mdsms.c
index 59f9bd9..e2b173f 100644 (file)
--- a/mdsms.c
+++ b/mdsms.c
@@ -69,6 +69,13 @@ static char rcsid[] ATTR_UNUSED = "$Id$";
 #include "getopt.h"
 #endif
 
+
+/* Always override possible system defintions as it is safe (used by glib) */
+#undef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+#undef MIN
+#define MIN(a,b) ((a)<(b)?(a):(b))
+
 #define NELEM(x) (sizeof((x))/sizeof(*(x)))
 
 #ifndef DEBUG