All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/8] osdep.h: Define macros for the benefit of C++ before C++11
Date: Thu, 18 Feb 2016 11:51:05 -0700	[thread overview]
Message-ID: <56C61299.60805@redhat.com> (raw)
In-Reply-To: <1455818725-7647-3-git-send-email-peter.maydell@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

On 02/18/2016 11:05 AM, Peter Maydell wrote:
> For C++ before C++11, <stdint.h> requires definition of the macros
> __STDC_CONSTANT_MACROS, __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS
> in order to enable definition of various macros by the header file.
> Define these in osdep.h, so that we get the right header file
> definitions whether osdep.h is being used by plain C, C++11 or
> older C++.
> 
> In particular libvixl's header files depend on this and won't
> compile if osdep.h is included before them otherwise.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  include/qemu/osdep.h | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> +/* Older versions of C++ don't get definitions of various macros from
> + * stdlib.h unless we define these macros before first inclusion of
> + * that system header.
> + */
> +#ifndef __STDC_CONSTANT_MACROS
> +#define __STDC_CONSTANT_MACROS
> +#endif

Style nit: In libvirt, we've grown used to writing:

#ifndef ...
# define ...
#endif

that is, use spacing to make it more visually obvious what level of
conditional nesting is in effect during preprocessor lines.  But short
of a tree-wide change to enforce that style (which I'm not advocating),
it's more of a food for thought comment, and has no bearing on taking
this series as is.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-02-18 18:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 18:05 [Qemu-devel] [PATCH 0/8] more include cleaning Peter Maydell
2016-02-18 18:05 ` [Qemu-devel] [PATCH 1/8] cpu: Clean up includes Peter Maydell
2016-02-18 18:05 ` [Qemu-devel] [PATCH 2/8] osdep.h: Define macros for the benefit of C++ before C++11 Peter Maydell
2016-02-18 18:51   ` Eric Blake [this message]
2016-02-18 18:05 ` [Qemu-devel] [PATCH 3/8] disas/arm-a64.cc: Include osdep.h first Peter Maydell
2016-02-18 18:05 ` [Qemu-devel] [PATCH 4/8] scripts/clean-includes: Enhance to handle header files Peter Maydell
2016-02-18 18:36   ` Peter Maydell
2016-02-18 19:04   ` Eric Blake
2016-02-18 20:07     ` Peter Maydell
2016-02-19 18:03     ` Peter Maydell
2016-02-18 18:05 ` [Qemu-devel] [PATCH 5/8] scripts/clean-includes: Add --all option Peter Maydell
2016-02-18 19:09   ` Eric Blake
2016-02-18 18:05 ` [Qemu-devel] [PATCH 6/8] osdep.h: Include config-target.h if NEED_CPU_H is defined Peter Maydell
2016-02-18 19:09   ` Eric Blake
2016-02-18 18:05 ` [Qemu-devel] [PATCH 7/8] all: Clean up includes Peter Maydell
2016-02-18 19:16   ` Eric Blake
2016-02-18 20:10     ` Peter Maydell
2016-02-18 18:05 ` [Qemu-devel] [PATCH 8/8] include: " Peter Maydell
2016-02-18 19:54   ` Eric Blake
2016-02-18 20:12     ` Peter Maydell
2016-02-18 20:04 ` [Qemu-devel] [PATCH 0/8] more include cleaning Eric Blake

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=56C61299.60805@redhat.com \
    --to=eblake@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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.