qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private
Date: Fri, 23 May 2014 16:33:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 23/05/2014 13:50, Peter Maydell ha scritto:
> On 23 May 2014 12:23, Andreas Färber <address@hidden> 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;

Credit: https://plus.google.com/u/0/+LinusTorvalds/posts/9gntjh57dXt

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]