[PATCH] util.h: define MIN macro only if it is not yet defined

Gregory Szorc gregory.szorc at gmail.com
Sun Jan 21 13:06:24 EST 2018


On Sun, Jan 21, 2018 at 6:40 AM, <andre.sintzoff at gmail.com> wrote:

> # HG changeset patch
> # User André Sintzoff <andre.sintzoff at gmail.com>
> # Date 1516545588 -3600
> #      Sun Jan 21 15:39:48 2018 +0100
> # Node ID 6330959c35f4128ed9b7b8d61b400251ecf2475a
> # Parent  5f5fb279fd394c117fb64a95ad7fd1e4db72951d
> util.h: define MIN macro only if it is not yet defined.
>

Queued, thanks.


>
> 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.
>
> diff -r 5f5fb279fd39 -r 6330959c35f4 mercurial/cext/util.h
> --- a/mercurial/cext/util.h     Thu Jan 18 00:50:12 2018 +0100
> +++ 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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180121/3e77da9e/attachment.html>


More information about the Mercurial-devel mailing list