Crossplatformity: MIN and MAX functiona are _always_ redefined, no #ifdefs
[mdsms.git] / mdsms.c
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