[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class |
Date: |
Mon, 6 Feb 2012 20:01:23 +0000 |
On 6 February 2012 19:24, Anthony Liguori <address@hidden> wrote:
> On 02/02/2012 08:59 PM, Andreas Färber wrote:
>> +#define CPU(obj) OBJECT_CHECK(CPU, (obj), TYPE_CPU)
>> +#define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU)
>> +#define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU)
>> +
>> +typedef struct CPU CPU;
>
> If this doesn't result in a build error, then C is a worse language than I
> thought it was :-/
>
> But we definitely shouldn't have a typename and macro name of the same thing
> and expect it to work...
The C standard says that function-like macros are only applied when
the function-like
macro name is followed by a '(' as the next preprocessing token, so this isn't
relying on any kind of gcc-specific behaviour.
Whether we *want* to do it is largely a style issue :-)
-- PMM
- Re: [Qemu-devel] [PATCH RFC v3 02/21] qom: Add QOM support to user emulators, (continued)
- [Qemu-devel] [PATCH RFC v3 09/21] target-arm: No longer abort on unhandled CPUIDs on reset, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 06/21] target-arm: Prepare model-specific class_init function, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 04/21] target-arm: Introduce QOM CPU and use it for CPUID lookup, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 17/21] target-arm: Store CLIDR in ARMCPUClass, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 03/21] qom: Introduce CPU class, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 07/21] target-arm: Overwrite reset handler for ti925t, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH v3 01/21] qom: Register QOM infrastructure early, Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 19/21] target-arm: Kill off cpu_reset_model_id(), Andreas Färber, 2012/02/02
- [Qemu-devel] [PATCH RFC v3 05/21] target-arm: Embed CPUARMState in QOM ARMCPU, Andreas Färber, 2012/02/02