cext: define MIN macro only if it is not yet defined
authorAndré Sintzoff <andre.sintzoff@gmail.com>
Sun, 21 Jan 2018 15:39:48 +0100
changeset 35775 440e8fce29e7
parent 35774 854a7315603e
child 35776 75bae69747f0
cext: define MIN macro only if it is not yet defined MIN macro is defined in <sys/param.h> on macOS Sierra. Therefore as HAVE_BSD_STATFS is defined in osutil.c, 'MIN' macro redefined warning is emitted.
mercurial/cext/util.h
--- a/mercurial/cext/util.h	Sun Jan 21 14:47:45 2018 +0800
+++ b/mercurial/cext/util.h	Sun Jan 21 15:39:48 2018 +0100
@@ -27,7 +27,9 @@
 extern PyTypeObject dirstateTupleType;
 #define dirstate_tuple_check(op) (Py_TYPE(op) == &dirstateTupleType)
 
+#ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
 /* VC9 doesn't include bool and lacks stdbool.h based on my searching */
 #if defined(_MSC_VER) || __STDC_VERSION__ < 199901L
 #define true 1