Tolerate existing definitions of MIN, MAX macros.
authorBen Pfaff <blp@nicira.com>
Thu, 4 Sep 2008 18:13:11 +0000 (11:13 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 4 Sep 2008 20:53:26 +0000 (13:53 -0700)
Enables partner builds.

include/util.h

index 99319d4..604c841 100644 (file)
@@ -59,8 +59,14 @@ extern const char *program_name;
 #define ARRAY_SIZE(ARRAY) (sizeof ARRAY / sizeof *ARRAY)
 #define ROUND_UP(X, Y) (((X) + ((Y) - 1)) / (Y) * (Y))
 #define ROUND_DOWN(X, Y) ((X) / (Y) * (Y))
+
+#ifndef MIN
 #define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
+#endif
+
+#ifndef MAX
 #define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
+#endif
 
 #define NOT_REACHED() abort()
 #define NOT_IMPLEMENTED() abort()