[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: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private |
Date: |
Fri, 23 May 2014 17:21:55 +0100 |
On 23 May 2014 15:33, Paolo Bonzini <address@hidden> wrote:
> 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;
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...
thanks
-- PMM
- [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private, Peter Maydell, 2014/05/09
- [Qemu-devel] [PATCH v2 1/4] Provide infrastructure for marking private QOM struct fields, Peter Maydell, 2014/05/09
- [Qemu-devel] [PATCH v2 2/4] arm_gic: Use new qom_private macro to mark private fields, Peter Maydell, 2014/05/09
- [Qemu-devel] [PATCH v2 4/4] arm11scu: Use qom_private to mark private fields, Peter Maydell, 2014/05/09
- [Qemu-devel] [PATCH v2 3/4] a9scu: Use qom_private to mark private fields, Peter Maydell, 2014/05/09
- Re: [Qemu-devel] [PATCH v2 0/4] Allow QOM struct fields to be marked as private, Peter Maydell, 2014/05/23