From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v2 1/6] tools/libxl: Introduce min and max macros Date: Wed, 11 Mar 2015 12:07:09 +0000 Message-ID: <1426075629.21353.211.camel@citrix.com> References: <1425668741-28003-1-git-send-email-andrew.cooper3@citrix.com> <1425668741-28003-2-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1425668741-28003-2-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Wei Liu , Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Fri, 2015-03-06 at 19:05 +0000, Andrew Cooper wrote: > This is the same set used by libxc. > > Signed-off-by: Andrew Cooper > CC: Ian Campbell > CC: Ian Jackson > CC: Wei Liu > > --- > v2: Don't use reserved identifiers in min_t/max_t > --- > tools/libxl/libxl_internal.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 934465a..fcbec7f 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -108,6 +108,22 @@ > > #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) > > +#define min(X, Y) ({ \ > + const typeof (X) _x = (X); \ > + const typeof (Y) _y = (Y); \ You've avoided the reserved-by-C names here, but IIRC a single underscore is reserved by POSIX. However since you've just copied from libxc, I think we can live with this until someone find the energy to fix them all: Acked-by: Ian Campbell Ian.