Il 23/05/2014 18:21, Peter Maydell ha scritto:
On 23 May 2014 15:33, Paolo Bonzini <pbonz...@redhat.com> wrote:
Il 23/05/2014 13:50, Peter Maydell ha scritto:
On 23 May 2014 12:23, Andreas Färber <afaer...@suse.de> wrote:
Am 23.05.2014 13:13, schrieb Peter Maydell:
Ping?

I believe I remarked that in the example
typedef struct Foo {
would be more in line with our Coding Style and majority of users.

Other than that, I have no objections and assumed you'll take it through
your arm queue.

Oops, yes, I'd forgotten that conversation. I'll remove
the newline preceding the '{' and am happy to put this
through the target-arm queue.

Semi-serious proposal:

    #define comma_if_empty_ ,
    #define CPP_IFEMPTY(macro, t, f)      CPP_IFEMPTY1(macro, t, f)
    #define CPP_IFEMPTY1(value, t, f)     CPP_IF2(comma_if_empty_##value, t, f)
    #define CPP_IF2(comma_if_true, t, f)  CPP_IF3(comma_if_true t, f)
    #define CPP_IF3(_, v, ...) v

    #define qom_private(macro) CPP_IFEMPTY(IMPLEMENTING_##macro,, 
QEMU_PRIVATE_ATTR)

To be used as:

    qom_private(A9_SCU) MemoryRegion iomem;

Interesting. That means we can avoid the irritating
boilerplate in each include file to define and undefine
qom_private, at the cost of the tag on each field in the
struct being a bit longer. I'm not entirely sure which
I prefer...

You could also

#define a9_scu_private qom_private(A9_SCU)

   a9_scu_private MemoryRegion iommu;

where the difference becomes a wash.

Paolo


Reply via email to