All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia@oracle.com>
To: Samuel Thibault <samuel.thibault@gnu.org>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, jan.kiszka@siemens.com
Subject: Re: [Qemu-devel] [PATCH] cutils: Define min and max marcos
Date: Mon, 28 Nov 2016 00:18:26 +0200	[thread overview]
Message-ID: <20161127221825.GA19258@yuval-lap> (raw)
In-Reply-To: <20161127141004.GL8854@var.home>

On Sun, Nov 27, 2016 at 03:10:04PM +0100, Samuel Thibault wrote:
> Hello,
> 
> Yuval Shaia, on Fri 25 Nov 2016 12:31:26 +0200, wrote:
> > -#ifndef _WIN32
> > -#define min(x,y) ((x) < (y) ? (x) : (y))
> > -#define max(x,y) ((x) > (y) ? (x) : (y))
> > -#endif
> 
> This has protection against _WIN32, I guess that was on purpose.

I'm not following.
Are you suggesting that this was there to prevent code from compiling when
_WIN32 was define?

> Perhaps qemu should avoid risking a clash with OS-provided min/max
> macros, by renaming these to qemu_min/max?

On MIN and MAX?

I have noticed some other approach which was taken in osdep.h with ifdef,
for example:
193 #ifndef ROUND_UP
194 #define ROUND_UP(n,d) (((n) + (d) - 1) & -(d))
195 #endif

> 
> Samuel

  reply	other threads:[~2016-11-27 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 10:31 [Qemu-devel] [PATCH] cutils: Define min and max marcos Yuval Shaia
2016-11-25 15:26 ` Markus Armbruster
2016-11-27 14:10 ` Samuel Thibault
2016-11-27 22:18   ` Yuval Shaia [this message]
2016-11-27 22:20     ` Samuel Thibault
2016-11-27 22:49       ` Yuval Shaia
2016-11-29  6:43 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161127221825.GA19258@yuval-lap \
    --to=yuval.shaia@oracle.com \
    --cc=jan.kiszka@siemens.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=samuel.thibault@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.